1833 days ago
Samtools commands for bioinformatician !
...positions samtools depth -a sorted_dupremoved.bam > depth.txt ### one liner to count mean depth samtoo...epth -a sorted_dupremoved.bam | awk '{c++;s+=$3}END{print s/c}' ### one liner to count coverage breadth sa...1603 days ago
Perl One-Liner to print only non-uppercase letters
#Go through file and only print words that do not have any uppercase letters. perl -ne 'print unless m/[A-Z]/' dna.fa > dnaOnlyLowercase.fa #To lowercase everything perl -pne 'tr/[A-Z]/[a-z]/' dnaUpperCase.fa >dnawithoutuppercase.fa;1383 days ago
bash script to extract sequence by ids !
Use a Perl one-liner, grep and seqtk subseq to extract the desired fasta sequences: # Create test input: cat > in.fasta BGI_novel_T016313 Solyc03g025570.2.1 TTCAAGTGTTA...823 days ago
Bash script to split multifasta file !
#Using awk, we can easily split a file (multi.fa) into chunks of size N (here, N=500), by using the following one-liner: awk 'BEGIN {n=0;} /^>/ {if(n%500==0){file=sprintf("chunk%d.f...823 days ago