1737 days ago
Perl script to run in parellel !
...my (%sequence_data); my $file_content = new Bio::SeqIO(-format => 'fasta',-file => "$file"); my $out_content = Bio::SeqIO->newFh(-format => 'fasta', ,-file => ">genomeRES.fa");...1701 days ago
Find and replace in multifasta or fasta header with perl onliner
You have a fasta file and you want to replace: "|" You are told to replace that by "_" perl -i -p -e "s/\|/_/g" genome.fasta -i = inplace editing -p = loop over lines and print each line (after processing) -e = command line script1630 days ago
Samtools commands for bioinformatician !
..._file.bam ### converting sam file into fasta samtools fasta reads_mapped.sam > reads.fast...e given samtools mpileup -g -f sal_ref_sej.fasta sal_sej_sorted.bam.bam > sal_...ormalize (realign) indels # -f : reference fasta, needed to left align and nor...1617 days ago
Python script to check sequence length in multifasta file
#!/usr/bin/python from Bio import SeqIO import sys cmdargs = str(sys.argv) for seq_record in SeqIO.parse(str(sys.argv[1]), "fasta"): output_line = '%s\t%i' % \ (seq_record.id, len(seq_record)) print(output_line)1229 days ago
Onliner to split the multifasta to singlefasta files !
#Split the multifasta to singlefasta # Multi fasta #Single fasta awk '$0 ~ "^>" { match($1, /^>([^:]+)/, id); filename=id[1]} {print >> filename".fa"}' sequence.fasta1415 days ago
1416 days ago
get GC across the entire CDS !
#look at GC across the entire CDS. gffread -x - -g | \ seqtk comp - | \ awk -v OFS="\t" '{ print $1, "0", $2, ($4 + $5) / $2 }'1407 days ago
Reformat the multifasta for sequence length !
#awk oneliner to reformat the multifasta sequences awk '!/^>/ {printf "%s", $0; n = "\n"} /^>/ {print n $0; n = ""}' file.fasta | fold -w 1001406 days ago
Bash script to handle Multifasta files
...wercase residues to uppercase in a FASTA sequence file $ awk 'BEGIN...toupper($0)}else{print $1}}' input.fasta > output.fasta #Rearrange...",$0);} END {printf("\n");}' input.fasta |\ >awk -F '\t' '{printf("%d...) {printf ">";} print $0; }' input.fasta > output.fasta #Match FAST...1371 days ago