This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*Headers | |
# H1 | |
## H2 | |
### H3 | |
#### H4 | |
*Change font style to italic: | |
_thistext_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PyPI | |
Is the module repository in Python (the equivalent to CPAN in Perl) | |
// | |
*Initializing 2 variables at the same time: | |
a=b=0 | |
or | |
a=b=0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
# Deactivating the activation of the base environment in Python: | |
conda config --set auto_activate_base false | |
// | |
#To install a package | |
conda install packagename | |
// | |
# specifying multiple channels when installing a package | |
$ conda install scipy --channel conda-forge --channel bioconda | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Example 1: | |
#!/usr/bin/env nextflow | |
params.str = 'Hello world!' | |
process AFcalc { | |
""" | |
echo '${params.str}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#split input_id from job | |
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(input_id, ' ', 1), ' ', -1) as prefix, | |
SUBSTRING_INDEX(SUBSTRING_INDEX(`input_id`, ' ', 2), ' ', -1) as data_id FROM job; | |
#select analysis_data_id using a join | |
select * from analysis_data where analysis_data_id in (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(`input_id`, ' ', 2), ' ', -1) as data_id FROM job where analysis_id=30 and status='RUN') | |
#select analysis_data and filtering according to one chromosome (chr8 in this case): | |
select * from analysis_data where analysis_data_id in (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(`input_id`, ' ', 2), ' ', -1) as data_id FROM job where analysis_id=29 and status='RUN') and data like '%8:%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '/gold/' coins.txt #look for all the records with the word gold and shows | |
these rows | |
// | |
awk '{if ($3 < 1980) print $3, " ",$5,$6,$7,$8}' coins.txt #$3 is a variable | |
that stores the 3rd word of each row . " " introduces 4 whitespaces for the | |
printing | |
// | |
awk '{if ($3 >= 0) print $3}' filename #same as the previous one but we add the equal sign | |
// | |
NR gives you the total number of records being processed or line number. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#getting an specific image | |
docker pull ubuntu | |
#A container is a running image that you start with the docker run command, like this: | |
$ docker run [OPTIONS] IMAGE [COMMAND] [ARG...] | |
#We then run a container from that image: | |
docker run -it ubuntu /bin/bash #And that’s it, root@4ff0be4995f0:/# means that we are root inside an Ubuntu container | |
/ | |
#Now, if we want to assign a name to the container created from the ubuntu image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*bcftools filter | |
*Filter variants per region (in this example, print out only variants mapped to chr1 and chr2) | |
qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz | |
*printing out info for only 2 samples: | |
bcftools view -s NA20818,NA20819 filename.vcf.gz | |
*printing stats only for variants passing the filter: | |
bcftools view -f PASS filename.vcf.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation. | |
// | |
#inline code block | |
This is an inline code block ``hello``. Yes | |
// | |
# Literal blocks | |
# The literal blocks need a blank line just before the literal block, also it needs to be indented. It requires another | |
# blank line after the literal block | |
This is a normal text paragraph. The next paragraph is a code sample:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a Singularity image from a Docker image that is in the Docker hub | |
// where /tmp/ is the folder where the image will be created and ubuntu:14.04 | |
// is the docker image used to convert to the Singularity image | |
docker run \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v /tmp/:/output \ | |
--privileged -t --rm \ | |
singularityware/docker2singularity \ | |
ubuntu:14.04 | |
// |
OlderNewer