Thank u so much ,, its so helpful previously i even don't know the direction ,,,
Actually in the output of this code whole annotation file comes after a small editing it gives genes information in the single file ,,
my $annotationsFn = "GCF_000298275.1_OryAfe1.0_genomic.gff"; my $resultsFn = "answer.gff"; open my $annotationsFh, "<", $annotationsFn or die "could not open annotations file handle!\n"; open my $resultsFh, ">", $resultsFn or die "could not open handle to results file!\n"; while (<$annotationsFh>) { chomp; if ($_ =~ /ACMSD/ || $_ =~ /CRYM/ || $_ =~ /ARID1B/ ) { print $resultsFh " $_\n";
I have two problems now first one is that all genes information come in a single file but i want different output file for different genes ,, for this i tried for loop but it did not work ,,
and second and major problem is that i have to work on about 150 annotation files and in annotation_file_path.txt i gave complete path of all annotation files but failed to execute it because script only work when a single annotation file use as shown above otherwise it print whole annotation _file_path.txt ,,, is there any way to iterate each path of annotation_file.txt one by one ??? kindly guide me ???
p.s i'm a beginner so happy to give me more info ....
Since you say you 'have' to write a perl script, have you tried any code? No one should write something for you if this is homework. That's not the purpose of this site. However, if you post a snippet of your code with an error message that you're having trouble with, someone can give you helpful hints.
if you have to write perl code, then below perl code by Alex may work. If you are a bioinformatician, you can use perl module for intersection: http://search.cpan.org/~cjfields/BioPerl-Run/lib/Bio/Tools/Run/BEDTools.pm