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 => ">$fil...2737 days ago
Perl script to insert the DNA string in genome
#!/usr/bin/perl use warnings; use strict; use Bio::SeqIO; use Bio::Seq; my $file = $ARGV[0]; # input fa...sequence of the insertion my $seq_in = Bio::SeqIO->new( -format => 'fa...th($seq->seq); my $upstream=substr($seq->seq, 0, $pos);...2706 days ago
Calculate ATGC percentage in parallel with perl
#!/usr/bin/perl use strict; use Parallel::ForkManager; use Bio::SeqIO; #usage: perl tes...xt_seq) { my $id = $seqobj->display_id; # there's yo...# hash to resolve PID's back to child specific informat...$pm->run_on_wait( sub { #print "** Have to w...2703 days ago
BASH script for SelfBLAST a genome
#!/bin/bash #self BLAST a genome -- Expecting you have blast and samtools installed in...AFILE=MergedContigs.fasta MYDB=myDB OUTFILE=seeRES THREAD=...t $USER; Me creating creating blastDB named $MYDB for you";...echo "Doing alignments -- BLASting"; blastn -task megabl...2699 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 $st...RGV[1]; my $end_pos = $ARGV[2]; my $in = Bio::SeqIO->new ( -file => $in_file, -format => 'fasta'); my $out = Bio::SeqIO->new( -file => ">$in...2674 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 => 'embos...ts of synonymous /nonsynonymous substitutions ## my $in = Bi...id) = map { $_->display_id } $alnobj->each_seq; my $results =...2696 days ago
2683 days ago
Check overlapping range with Perl
#!/usr/bin/perl use strict; use warnings; my @ranges = 0; push @ranges, $ra...s = map int rand $ranges[-1], 0..1000000; match (\@ranges, \@tests); sub div { my ($border, $tests) = @_; my (...2674 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 = p...{^POSTMATCH}; $seq =~ s/\s//g; print $header; print +( substr $seq, $start - 1, $end ) ....2669 days ago
Transpose the file coordinates and plot dendrogram in R
#Save this as tr.awk { for (i=1; i2664 days ago