#!/usr/bin/perl -w use warnings; use warnings FATAL => q{void}; use warnings FATAL => 'syntax'; use strict; use Data::Dumper; print "Enter your chromosome"; my $chromosome = ; chomp $chromosome; print "Your file is '$chromosome'\n"; # reading whole file $file_name = $ARGV[0]; open(my $file, '<', $file_name) or die "Sorry, we can't open your $file_name $!"; @content= <$file>; close $file; print "\n\n"; $index_max = $#content; for ($start=0; $start <= $index_max; $start++) { chomp $content[$i]; print "Reg $i: $content[$i]\n"; if ($content[$start] =~ /CDS/ ) { print "There is CDS \n"; for ($start;$start <= $index_max; $start++) { @cds = (@cds, $content[$start]); print @cds; } open (WRITE, ">>concatenare.txt"); print WRITE @cds; close WRITE; } #This chromosome have tags. Identify CDS ones. my @features =$mySeq ->all_seqfeatures(); foreach $feature (@features) { my @tag = $CDS; my @feat = $join; foreach $tag ( $feat->all tags() ); print "Feature region has tag", $tag, "CDS", join(‘ ‘,$feat->each tag value($tag)), "\n"; } if ($content[$start] =~ /ORIGIN/ ) { print "There is ORIGIN !! \n"; for ($start;$start <= $index_max; $start++) { @origin = (@origin, $content[$start]); shift (@origin); #Delete ORIGIN row; print @origin; for @origin { while ($_ =~ m/[ACGTURYKMSWBDHVN]/ig) { $seq = $seq.$&; } } $lenght = length($seq); print "The sequence has $nucleotide length\n"; print "$seq"; } } } print "There is ",$index_max," inregistrari\n"; print "This are:\n\n"; my $file = "concatenare.txt"; my $succ = open( my $fh , '>>', $file ); $fh = *STDOUT unless $succ; print $fh "CDS1 \n"; print $fh "Nucleotide sequence \n"; print $fh "CDS2 \n"; print $fh "Nucleotide sequence \n";