2914 days ago
2914 days ago
Perl subroutine to read and write files
...$file for input: $!\n"; my @file = ; close InOut; return wantarray ? @file : join '', @fil...pen InOut,"> $file" or die "Cannot open $file for output: $!\n"; print InOut ref $data eq 'ARRAY' ?...2908 days ago
Perl script introduces control structures, arrays and hashes.
...ray = ('DNA', 'ATGCGTGC', 5, 'RNA', 'AUGC'); print $first_array[0], "\n\n"; #...size_of_array = @first_array; # implicit way print "Scalar of array: $size_of_ar...nother_way_of_getting_size_of_array\n\n"; # Control Loop: for for (my $i=0;...2904 days ago
Blast script to index and extract sequence !!
...AAAAATTACAGAGTAC # generate the blast database $ makeblastdb -dbtype nucl -out EC -in EC4115.fa -parse_seqids # retreive an entry by id $ blastdbcmd -db EC -entry 'NC_011353.1' | head >lcl|...2894 days ago
Perl script to insert sequence in contig !!
# sub signature: #insertSEQintoCONTIGatLOC( SEQ , CONTIG , LOC ) ; sub insertSEQintoCONTIGatLOC{ my ( $SEQ , $CONTIG ,...substr( $CONTIG , $LOC , -length($CONTIG) ) = $SEQ ; return $CONTI...t 'insert = '.($s = insertSEQintoCONTIGatLOC( "CCCC ", $s , 26 ))."...2751 days ago
2747 days ago
2735 days ago
2735 days ago
Calculate ATGC percentage in parallel with perl
...t code $pm->run_on_finish ( sub { my ($pid, $exit_code, $ident) = @_; #print "** $ident just got out of th...C/g); my $AT=($DNA=~s/AT/AT/g); my $GCper=($GC/($Total)*100); print"$name\t$Total\t$AT\t$GC\t$GCp...2698 days ago