1832 days ago
Samtools commands for bioinformatician !
## count mapped reads samtools view -c -F 260 mapping_file.bam ### converting sam file into fasta samtools fasta reads_mapped.sam > reads.fasta ### converting...1601 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;1382 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...822 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...821 days ago