ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/gffread/gffread.cpp
(Generate patch)
# Line 9 | Line 9
9  
10   #define USAGE "Usage:\n\
11   gffread <input_gff> [-g <genomic_seqs_fasta> | <dir>][-s <seq_info.fsize>] \n\
12 < [-o <outfile.gff>] [-t <tname>] [-r [[<strand>]<chr>:]<start>..<end>] \n\
13 < [-CTVNJMKQAFGRUVBHZWTOLE] [-w <spl_exons.fa>] [-x <spl_cds.fa>] [-y <tr_cds.fa>]\n\
12 > [-o <outfile.gff>] [-t <tname>] [-r [[<strand>]<chr>:]<start>..<end> [-R]]\n\
13 > [-CTVNJMKQAFGUBHZWTOLE] [-w <exons.fa>] [-x <cds.fa>] [-y <tr_cds.fa>]\n\
14   [-i <maxintron>] \n\
15   Filters and/or converts GFF3/GTF2 records.\n\
16   <input_gff> is a GFF file, use '-' if the GFF records will be given at stdin\n\
# Line 24 | Line 24
24        <seq-name> <seq-length> <seq-description>\n\
25        (useful for -A option with mRNA/EST/protein mappings)\n\
26    -i  discard transcripts having an intron larger than <maxintron>\n\
27 <  -r  only show transcripts crossing coordinate range <start>..<end>\n\
27 >  -r  only show transcripts overlapping coordinate range <start>..<end>\n\
28        (on chromosome/contig <chr>, strand <strand> if provided)\n\
29    -R  for -r option, discard all transcripts that are not fully \n\
30 <      contained within given range\n\
30 >      contained within the given range\n\
31    -U  discard single-exon transcripts\n\
32    -C  coding only: discard mRNAs that have no CDS feature\n\
33    -F  full GFF attribute preservation (all attributes are shown)\n\
# Line 602 | Line 602
602    if (reftbl.Count()>0) {
603          GStr refname(gffrec->getRefName());
604          RefTran* rt=reftbl.Find(refname.chars());
605 <        if (rt==NULL && refname[-2]=='.' && isdigit(refname[-1])) {
606 <           //try removing the version
605 >        if (rt==NULL && refname.length()>2 && refname[-2]=='.' && isdigit(refname[-1])) {
606 >           //try removing the version suffix
607             refname.cut(-2);
608             //GMessage("[DEBUG] Trying ref name '%s'...\n", refname.chars());
609             rt=reftbl.Find(refname.chars());
# Line 639 | Line 639
639       if (rfltStart!=0 || rfltEnd!=MAX_UINT) {
640         if (rfltWithin) {
641           if (gffrec->start<rfltStart || gffrec->end>rfltEnd) {
642 <            return false;
642 >            return false; //not within query range
643              }
644           }
645         else {
# Line 673 | Line 673
673  
674   int main(int argc, char * const argv[]) {
675   GArgs args(argc, argv,
676 <   "debug;merge;cluster-only;help;MINCOV=MINPID=hvOUNHWCVJMKQNSXTDAPRZFGLEm:g:i:r:s:t:a:b:o:w:x:y:d:");
676 >   "debug;merge;cluster-only;help;force-exons;MINCOV=MINPID=hvOUNHWCVJMKQNSXTDAPRZFGLEm:g:i:r:s:t:a:b:o:w:x:y:d:");
677   args.printError(USAGE, true);
678   if (args.getOpt('h') || args.getOpt("help")) {
679      GMessage("%s",USAGE);
680      exit(1);
681      }
682   debugMode=(args.getOpt("debug")!=NULL);
683 + bool forceExons=(args.getOpt("force-exons")!=NULL);
684   mRNAOnly=(args.getOpt('O')==NULL);
685   //sortByLoc=(args.getOpt('S')!=NULL);
686   addDescr=(args.getOpt('A')!=NULL);
# Line 713 | Line 714
714        exit(1);
715        }
716      }
716 //protmap=(args.getOpt('P')!=NULL);
717   if (fullCDSonly) validCDSonly=true;
718   if (verbose) {
719       fprintf(stderr, "Command line was:\n");
# Line 786 | Line 786
786        rfltEnd=(uint)gsend.asInt();
787        if (rfltEnd==0) rfltEnd=MAX_UINT;
788        }
789  
789     } //gseq/range filtering
790   else {
791     if (rfltWithin)
792 <     GError("Error: option -R doesn't make sense without -r!\n");
792 >     GError("Error: option -R requires -r!\n");
793 >   //if (rfltWholeTranscript)
794 >   //  GError("Error: option -P requires -r!\n");
795     }
796   s=args.getOpt('m');
797   if (!s.is_empty()) {
# Line 840 | Line 841
841     gffloader.mergeCloseExons=mergeCloseExons;
842     gffloader.showWarnings=(args.getOpt('E')!=NULL);
843     gffloader.load(g_data, &validateGffRec, doCluster, doCollapseRedundant,
844 <                             matchAllIntrons, fuzzSpan);
844 >                             matchAllIntrons, fuzzSpan, forceExons);
845     if (doCluster)
846       collectLocusData(g_data);
847     if (numfiles==0) break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines