Perl script to remove the duplicate sequences from multifasta file
use strict; use Bio::SeqIO; my %unique; my $file = "myseqs.fa"; my $seqio = Bio::SeqIO->new(-file => $file, -format => "fasta"); my $outseq = Bio::SeqIO->new(-file => ">$file.uniq", -fo...lay_id; my $seq = $seqs->seq; unless(exists($unique{$seq})) {...2741 days ago
Perl script to insert the DNA string in genome
...q; my $file = $ARGV[0]; # input fasta file (genome file)...sta file my $chr="test"; #insertion chromosome my $pos=10...); my $seq_out = Bio::SeqIO->new( -format => 'fasta',-file =...w(-seq => $upstream.$seqI.$downstream,-display_id => $seq->pr...2710 days ago
Calculate ATGC percentage in parallel with perl
#!/usr/bin/perl use strict; use Parallel::ForkManager; use Bio::SeqIO; #usa...); while(my$seqobj = $seqio->next_seq) { my $id = $seq...\n"; } ); $pm->run_on_start( sub { my ($pid...me\t$Total\t$AT\t$GC\t$GCper:\n"; }2707 days ago
BASH script for SelfBLAST a genome
#!/bin/bash #self BLAST a genome -- Expecting you have blast and samtools installed in your system #Author: Jitendr...: ./selfBlast.sh all #Common settings FASTAFILE=MergedCo...AKE SURE U HAVE ADDED CORRECT NAME" samtools faidx MergedC...2703 days ago
Extract a range from genome file with perl.
#!/usr/bin/perl use strict; use warnings; use Bio::SeqIO; my $in_file = $ARGV[0]; my $start_pos = $ARGV[1]; my $end_pos = $ARGV[2]; my $in = Bio::SeqIO->new ( -fi...'fasta'); my $out = Bio::SeqIO->new( -file => ">$in_file.out", -format => 'fasta'...2678 days ago
Calculate some statistics for a DNA alignment with Perl
use Bio::AlignIO; use Bio::Align::DNAStatistics; my $stats = Bio::Align::DNAStatistics->new(); my $alignin = Bio::AlignIO->new(-format => 'emboss',...my $aln = $alignin->next_aln; my $jcmatrix = $stats->di...comparing ". $an->{'Seq1'}." and ". $an->{'Seq2'}. " \n";...2701 days ago
2688 days ago
Check overlapping range with Perl
#!/usr/bin/perl use strict; use warnings; my @ranges = 0; push @ranges, $ranges[-...for 1..10000; my @tests = map int rand $ranges[-1], 0..1000000...); } sub match { my ($ranges, $tests) = @_; if (@$...else { my $pivot = int((@$ranges + 1)/ 2);...2679 days ago
Extracting FASTA sequences based on position with perl script !!
#!/usr/bin/env perl #Uses: perl sub-seq.pl input.txt range use strict; use warnings; my $end = pop; my $start =...= '>'; while () { chomp; next unless /(.+)/; my ($h...print +( substr $seq, $start - 1, $end ) . "\n"; }...2673 days ago
Transpose the file coordinates and plot dendrogram in R
#Save this as tr.awk { for (i=1; i2669 days ago