Perl and BioPerl script to extract protein sequences using GFF file !
...ings; use Bio::DB::Fasta; use Bio::SeqIO; # Paths to your GFF file and genome FASTA file my $gff_file = 'path/to/your/file.gff'; my $gen...ene_id_to_extract = 'your_gene_id'; # Step 1: Parse GFF file to get gene locat...153 days ago
Perl script for six frame translation !
#!/usr/bin/perl use strict; use warnings; use Bio::SeqIO; # Path to your input nucleotide sequence file in FASTA format my $input_fasta = 'path/to/your/input.fasta'; #...153 days ago
Python script for six frame translation of sequences !
...d_seq def six_frame_translation(fasta_file): records = list(SeqIO.parse(fasta_file, "fasta"))...ame_type} {abs(frame)} Translation:\n{protein_sequence}\n") # Replace 'path/to/your/input.fasta' with t...153 days ago
Raku script to find overlaps between two bed files !
...r of arguments are provided if @*ARGS.elems != 2 { say "Usage: ./compare_bed_files.raku file1.bed fi...ay "File 2: $line2"; say ""; } } } say "Comparison completed.";153 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, '153 days ago
Perl script to parse VCF file !
...use strict; use warnings; # Usage: ./parse_vcf.pl input.vcf die "Usage: ./parse_vcf.pl input.vcf\n" unless...cf_file = shift @ARGV; my @vcf_entries = parse_vcf($vcf_file); print "...omosome_counts{$chromosome}\n"; } sub parse_vcf { my ($file) = @_...153 days ago
Perl script to parse blast results and plot basic stats !
...use List::Util qw(sum); # Usage: ./parse_blast.pl blast_result.txt die "Usage: ./parse_blast.pl blast_result.txt\...ile = shift @ARGV; my @blast_entries = parse_blast($blast_file); pri...Score: $avg_bitscore\n"; sub parse_blast { my ($file) =...153 days ago
Python script for basic stats of the assembled genome !
...computing statistics total_length = 0 num_contigs = 0 contig_lengths = [] # Iterate through each sequence in the assembly for record in SeqIO.parse(input_file, 'fasta'):...153 days ago
Python script to finds extact similar sequence between two multi fasta files !
...print("Error running BLAST:") print(stderr) def parse_blast_results(output_file): # Parse BLAST results with op...ocal_blast(query_file, subject_file, output_file) # Parse and print BLAST results...62 days ago
Python script to parse GFF file
def parse_gff(gff_file): features = [] with open(gff_file, 'r') as f:...feature) return features # Usage example gff_file = 'example.gff' parsed_features = parse_gff(gff_file) for feature...98 days ago