]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/GFF.pm
added qual_valid? method to Seq.rb
[biopieces.git] / code_perl / Maasha / GFF.pm
index 0a5608d668d1aa3e2f72791e2b0ac95a25bb0485..6201b09bb74683a8e5a5f57056d877b8a935b1e4 100644 (file)
@@ -91,6 +91,8 @@ sub gff_entry_get
 
         @fields = split /\t/, $line;
 
+        next if scalar @fields < 9;
+
         return wantarray ? @fields : \@fields;
     }
 }
@@ -143,9 +145,9 @@ sub gff2biopiece
         'S_ID'   => $entry->[ seqid ],
         'SOURCE' => $entry->[ source ],
         'TYPE'   => $entry->[ type ],
-        'S_BEG'  => $entry->[ start ],
-        'S_END'  => $entry->[ end ],
-        'S_LEN'  => $entry->[ end ] - $entry->[ start ] + 1,
+        'S_BEG'  => $entry->[ start ] - 1,
+        'S_END'  => $entry->[ end ]   - 1,
+        'S_LEN'  => $entry->[ end ]   - $entry->[ start ] + 1,
         'SCORE'  => $entry->[ score ],
         'STRAND' => $entry->[ strand ],
         'PHASE'  => $entry->[ phase ],