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 #Rearrange FASTA se...1362 days ago
955 days ago
Command line to download blast database / protein
#download all available nr - protein database as a single file #Database location - NCBI where all databases are available ftp://ftp.ncbi.nlm.nih.gov/blast/db/ https://ftp.ncbi.nlm....948 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.fa933 days ago
Multiline fasta to single line fasta !
perl -pe '$. > 1 and /^>/ ? print "\n" : chomp' in.fasta > out.fasta800 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.fa771 days ago
Python script to convert Multi-line Fasta to Single-line Fasta
def multi_to_single_line_fasta(input_filename, output_filename): try: with open(input_filename, 'r') as input_file: with open(output_filename, 'w') as output_fi...100 days ago
Perl script to convert Multi-line Fasta to Single-line Fasta !
#!/usr/bin/perl use strict; use warnings; sub multi_to_single_line_fasta { my ($input_filename, $output_filename) = @_; open my $input_file, '', $output_filename or die...100 days ago
Bash script to convert Multi-line Fasta to Single-line Fasta !
#!/bin/bash input_filename="multi_line.fasta" output_filename="single_line.fasta" awk '/^>/ {printf("\n%s\n", $0);next; } { printf("%s", $0);} END {printf("\n");}' "$input_filename...100 days ago