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 ( -file =...2621 days ago
Calculate some statistics for a DNA alignment with Perl
...t/data/nei_gojobori_test.aln'); my $alnobj = $in->next_aln; my ($seq1id,$seq2id) = map { $_->displa...} $alnobj->each_seq; my $results = $stats->calc_KaKs_pair($alnobj, $seq1id, $seq2id); print "compar...2643 days ago
2630 days ago
Check overlapping range with Perl
...ngs; my @ranges = 0; push @ranges, $ranges[-1] + 1 + int rand 200 for 1..10000;...my ($ranges, $tests) = @_; if (@$ranges == 1) { if (@$tests) {...else { my $pivot = int((@$ranges + 1)/ 2); my ($lt, $ge)...2621 days ago
Extracting FASTA sequences based on position with perl script !!
...while () { chomp; next unless /(.+)/; my ($header) = "$/$1_$start-$end\n"; my $seq...$seq =~ s/\s//g; print $header; print +( substr $seq, $start - 1, $end ) . "\n"; }...2615 days ago
Transpose the file coordinates and plot dendrogram in R
#Save this as tr.awk { for (i=1; i2611 days ago
Extract ids from file with perl
...$idHash{$cells[0]}=$.; push @allIds, $cells[0]; } #Delete the last id for secutiry -- might does not finish all steps delete $hash{$allIds[-1]}; next if exists $hash{$loo...2602 days ago
picard tools command to get some insert statistics
#picard tools to get some insert statistics to see whether our reads seem to be in the correct place #module load picard/2.0.1 java -Xmx16g -XX:PermSize=8g -jar $PICARD_HOME/picard.j...1331 days ago
Extract fasta sequence from a multifasta file with coordinates
...xtractFASTAwithSIZE.pl finalSample_filtered.fa 0 1000 > aaaaaa.fa my $fastaFi...qstr = $db->seq('CHROMOSOME_I', 4_000_000 => 4_100_000); my $revseq = $db...eq; my $subseq = $seq->subseq(4_000_000 => 4_100_000); my $trunc = $seq...2526 days ago
Download the genome from NCBI using bash script/command
...lm.nih.gov/genomes/all/.+/)(GCF_.+)|\1\2/\2_genomic.fna.gz|' > genom...lm.nih.gov/genomes/all/.+/)(GCF_.+)|\1\2/\2_genomic.fna.gz|' > genom...lm.nih.gov/genomes/all/.+/)(GCF_.+)|\1\2/\2_genomic.fna.gz|' > genom...lm.nih.gov/genomes/all/.+/)(GCF_.+)|\1\2/\2_genomic.fna.gz|' > genom...2526 days ago