2877 days ago
2877 days ago
Perl subroutine to read and write files
# Input output (InOut) the file # usage: # @array = InOut('rea...pen InOut,"< $file" or die "Cannot open $file for input: $!\n"; my @file = ;...n InOut,"> $file" or die "Cannot open $file for output: $!\n"; print InOut re...2872 days ago
Perl script to insert sequence in contig !!
...AG"; print "s = $s \n"; print 'insert = '.($s = insertSEQintoCONTIGatLOC( "CCCC ", $s , 26 ))."\n"; print " (now, s = '$s' ) \n"; # OUTPUT: # s = ATATGATGATAGATGATAGT...2714 days ago
2710 days ago
2699 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 fasta file (genome file) my $out = $ARGV[1]; # output fasta file my $chr="test"; #insertion ch...2665 days ago
Check overlapping range with Perl
#!/usr/bin/perl use strict; use warnings; my @ranges = 0; push @ranges, $ranges[-1] + 1 + int rand...div { my ($border, $tests) = @_; my ($lt, $ge) = ([], []); push @{$_ < $border ? $lt : $ge}...2633 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 = pop; local $/ = '>'; while () { chomp;...2627 days ago
Extract ids from file with perl
...nings; my $fh=read_fh("fin.txt"); my %idHash; my $lastKey; while () { chomp $_; my @cells = split /\t/, $_; $idHash{$cells[0]}=$.; push @allIds, $cells[0]; } #...2614 days ago