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(-...2689 days ago
Perl script to insert the DNA string in genome
...r/bin/perl use warnings; use strict; use Bio::SeqIO; use Bio::...$ARGV[1]; # output fasta file my $chr="test"; #insertion chromoso...insertion my $seqI = "AAAA"; #sequence of the insertion my $seq_...) { if($seq->primary_id eq $chr){ my $length = len...2658 days ago
Calculate ATGC percentage in parallel with perl
...testParallel.pl my %sequences; my $seqio = Bio::SeqIO->n...here's your value $sequences{$id} = $seq; } my $ma...Parallel::ForkManager($max_procs); # Setup a callback for...0.5 ); NAMES: foreach my $child ( 0 .. $#names ) {...2655 days ago
BASH script for SelfBLAST a genome
...#USAGE: ./selfBlast.sh extract #USAGE: ./selfBlast.sh all...on settings FASTAFILE=MergedContigs.fasta MYDB=myDB OUTFI...asta genome exists" else echo "Thanks for testing this sc...echo "You want entire sequence to blast" SEQ=$FASTAFILE...2651 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_po...->display_id() . "_$start_pos-$end_pos" ); $out->write_seq( $seq->trunc($start_pos, $end_pos) ); }2626 days ago
Calculate some statistics for a DNA alignment with Perl
...use Bio::Align::DNAStatistics; my $stats = Bio::Align::DNAStatistics->new(); my $alignin = Bio...= $alignin->next_aln; my $jcmatrix = $stats->distance(-ali...{ $_->display_id } $alnobj->each_seq; my $results = $stats...} my $result3 = $stats->calc_average_KaKs($alnobj, 1000...2648 days ago
2635 days ago
Check overlapping range with Perl
#!/usr/bin/perl use strict; use warnings; my @ranges = 0;...nt rand $ranges[-1], 0..1000000; match (\@ranges, \@tests); sub...tests; ($lt, $ge); } sub match { my ($ranges, $tests)...nges->[$pivot], $tests); match([@{$ranges}[0..$pivot-1]], $...2626 days ago
Extracting FASTA sequences based on position with perl script !!
...ses: perl sub-seq.pl input.txt range use strict; use warnings; my $end = pop; my $start = pop; local $/ = '>'; while () {...= "$/$1_$start-$end\n"; my $seq = ${^POSTMATCH}; $seq =~ s/\s//g;...2621 days ago
Transpose the file coordinates and plot dendrogram in R
#Save this as tr.awk { for (i=1; i2616 days ago