From: preecej Date: Wed, 13 Oct 2010 00:47:00 +0000 (+0000) Subject: Added system call to sort the results file and remove exact dupes. X-Git-Url: http://gitweb.planteome.org/?a=commitdiff_plain;h=7f948f7370075be60e59145b22b58dc071b628ac;p=old-jaiswallab-svn%2F.git Added system call to sort the results file and remove exact dupes. svn path=/; revision=66 --- diff --git a/preecej/perl_singletons/reactome_chebi_mapping/reactome_chebi_mapping.pl b/preecej/perl_singletons/reactome_chebi_mapping/reactome_chebi_mapping.pl index bb44688..46b3cf5 100755 --- a/preecej/perl_singletons/reactome_chebi_mapping/reactome_chebi_mapping.pl +++ b/preecej/perl_singletons/reactome_chebi_mapping/reactome_chebi_mapping.pl @@ -38,9 +38,10 @@ use GO::Parser; # set paths to data files my $data_path = "/home/preecej/Documents/Projects/Reactome/"; -my $chebi_obo_file = "chebi_sample.obo"; -my $reactome_file = "RiceReferenceMolecules_sample.txt"; -my $mapped_output_file = "reactome_chebi_mapping.txt"; +my $chebi_obo_file = "chebi.obo"; +my $reactome_file = "RiceReferenceMolecules.txt"; +my $mapped_output_file = "reactome_chebi_mapping_complete.txt"; +my $sorted_output_file = "reactome_chebi_mapping_complete_sorted.txt"; # options my $allow_obsolete_terms = 1; @@ -317,6 +318,9 @@ sub create_mapfile print OUTPUT_FILE "$_\n" foreach @map_results; close OUTPUT_FILE; + + # sort on all cols (keep the header at the top), remove exact dupes + system "awk 'NR == 1; NR > 1 {print \$0 | \"sort\"}' $data_path$mapped_output_file | uniq > $data_path$sorted_output_file"; } else { print "\n\nSorry, there are no mapped results.\n\n"; }