2925 days ago
Blast result parser with Perl and Bioperl
#!/usr/local/bin/perl # # Dr. Xiaodong Bai # It may be freely d...# This script will parse a NCBI blastx output file and output the to..._end\tpositives\tidentical\n"; # extraction of information for ea...ively while (my $hit = $result->next_hit) { print OUT "\t" if...2929 days ago
Find and replace ambiguous characters in fasta file with Perl and Bioperl
...(-file => $file, -format => $format); while (my $seq = $seqio_obj->next_seq()) { push(@seqArr, $se...at); foreach my $s (@seqArr) { $seqOut->write_seq($s); } } exit; sub AmbiguousChar {...2929 days ago
Perl program to implement sliding window !
#!/usr/bin/perl -w my $filename = 'data.txt'; open(my TR, '2929 days ago
2924 days ago
Find the number of each 2 consecutive characters AA, AC,AG,AT,CC,CA... with Perl
...use strict; my $subject = "AACGTACTGACGTACTGGTTGGTACGA"; my %results = (); while ($subject =~ m/[ACTG][ATGC]/g) { # matched text = $& if(exists $results{$&}) {...2924 days ago
Needleman-Wunsch Algorithm in Perl
...USAGE: perl nw.pl HEAGAWGHEE PAWHEAE BLOSUM50.txt -8 # See: "Biological...\n" unless @ARGV == 4; # get sequences, matrix and gapcost from command line...= @ARGV; # scoring scheme (instead of using fixed MATCH and MISMATCH scores w...2920 days ago
Count GC Content in nucleotide sequence with Perl
...-------------------------------------------------------------------------------- if ($#ARGV == -1) { usage(); exit; } $fasta_file = $ARGV[0]; $out_file = "gc_out.txt"; unless ( open(IN, "$fasta...2920 days ago
Perl script to extract lines with matching ids !!
#!/usr/bin/perl use strict; use warnings; my %patterns; #USAGE: perl extactByIds.pl Idsfile1 file2 > Result # Open file and get patterns to search for open(my $fh2,"2890 days ago
Perl script to extract fasta sequence by matching name/ids !!
.../perl use strict; use warnings; use Text::Trim qw(trim); #Usage perl extractSeqbyID.pl ids.txt seq.fasta Result.fasta $ARGV[2] or die "use extractSeqbyID.pl LIST FASTA OUT...st" or die; while () { chomp; next if /^\s*$/; s/>//g;...2890 days ago