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_file: current_sequence =...111 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 "Error: Could not open f...111 days ago
110 days ago
Perl and BioPerl script to extract protein sequences using GFF file !
#!/usr/bin/perl use strict; use warnings; use Bio::DB::Fasta; use Bio::SeqIO; # Paths to your GFF file and...ne_id'; # Step 1: Parse GFF file to get gene locations my %gene_locations; open m...110 days ago
Perl script to find overlaps between two bed files !
#!/usr/bin/perl use strict; use warnings; # Check if the correct number of arguments are provided if (@ARGV != 2) { die "Usage: $0 file1.bed file2.bed\n"; } # Read the contents of the two BED files my $file1 = shift @ARGV; my $file2 = shift @ARGV; open my $fh1, '110 days ago
Perl script to parse VCF file !
#!/usr/bin/perl use strict; use warnings; # Usage: ./parse_vcf.pl input.vcf die "Usage: ./parse_vcf.pl i...some_counts{$chromosome}\n"; } sub parse_vcf { my ($file) = @_; open m...110 days ago
Perl script to parse blast results and plot basic stats !
#!/usr/bin/perl use strict; use warnings; use List::Util qw(sum); # Usage: ./parse_blast.pl blast_result.t...re: $avg_bitscore\n"; sub parse_blast { my ($file) = @_; open m...110 days ago
Perl script to calculate the basic stats of the assembled genome !
#!/usr/bin/perl use strict; use warnings; use Bio::SeqIO; # Input file containing the genome assembly in FAS...{ my ($file) = @_; my $gc_count = 0; my $total_bases = 0; open m...110 days ago
Python script for basic stats of the assembled genome !
from Bio import SeqIO import statistics # Input file containing the genome assembly in FASTA format input_fil...calculate_gc_content(file): gc_count = 0 total_bases = 0 with open(f...110 days ago
Python script to convert fastq to fasta
def fastq_to_fasta(fastq_file, fasta_file): with open(fastq_file, 'r') as fq: with open(fasta_file, 'w') as fa: while True: # Read four lines from the FASTQ...54 days ago