Samtools commands for bioinformatician !
...ools view -c -F 260 mapping_file.bam ### converting sam file into fasta samto...s fasta reads_mapped.sam > reads.fasta ### converting sam file into bam # -b :...################ # try these recipies: ### convert BAM to FASTA: samtools view...1604 days ago
To convert just one specific read group to fastq
...# Reverting the process is to extract reads, tagged with readgroups to paired files. samtools fastq -t -1 all1.fq -2 all2.fq all.bam # To convert just one specific read group....1543 days ago
Bash script to handle Multifasta files
#Convert all lowercase residues to uppercase in a FASTA sequence file $ awk 'BEGIN{FS=" "}{if(!/>/){print toupper($0)}else{print $1}}' input.fasta > output.fasta #...1358 days ago
1216 days ago
997 days ago
Tadpole is 250x faster than SPADes assembler !
...containing errors. markquality=0 (mq) Set quality scores for marked bases to this. A level of 0 will also convert the base to an N. errormult1...977 days ago
Oneliner to convert lower-case to sequence masked with Ns
perl -pe '/^[^>]/ and $_=~ s/[a-z]/N/g' genomic.fna > genomic.N-masked.fna awk '{if(/^[^>]/)gsub(/[a-z]/,"N");print $0}' genomic.fna > genomic.N-masked.fna951 days ago
Onliner to convert multi line fasta to single line fasta !
#Oneliner to convert awk '/^>/ {printf("\n%s\n",$0);next; } { printf("%s",$0);} END {printf("\n");}' < file.fa > fileres.fa #Then delete the first empty line tail -n +2 fileres.fa > fileout.fa929 days ago
Bash script to simulate a genome !
...d SAMtools 1.10 conda activate bcftools1.10.2 # Use Seqtk to convert soft-masked bases to upper-ca...75 > GCA_003401745.1_ASM340174v1_genomic.fna_upper.fasta.gz # Convert to diploid with approximately...919 days ago
Bash script to convert multiline fasta to single line fasta !
#file.fa is multiline fasta awk '/^>/ {printf("\n%s\n",$0);next; } { printf("%s",$0);} END {printf("\n");}' < file.fa767 days ago