Skip to content

Commit

Permalink
Adding in codec to read from Gencode GTF files. Fixes #3277
Browse files Browse the repository at this point in the history
Includes tests for both hg19 and hg38.
  • Loading branch information
jonn-smith committed Aug 11, 2017
1 parent c655fef commit b12a3ef
Show file tree
Hide file tree
Showing 28 changed files with 6,159 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package org.broadinstitute.hellbender.utils.codecs.GENCODE;

import java.util.ArrayList;

/**
* A Gencode GTF Feature representing a CDS.
*
* A GTF Feature represents one row of a GTF File.
* The specification of a GTF file is defined here:
* http://mblab.wustl.edu/GTF22.html
*
* Created by jonn on 7/25/17.
*/
// {gene,transcript,exon,CDS,UTR,start_codon,stop_codon,Selenocysteine}`
final public class GencodeGtfCDSFeature extends GencodeGtfFeature {

private GencodeGtfCDSFeature(String[] gtfFields) {
super(gtfFields);
}

public static GencodeGtfFeature create(String[] gtfFields) {
return new GencodeGtfCDSFeature(gtfFields);
}

private GencodeGtfCDSFeature(long featureOrderNumber,
String chromosomeName,
AnnotationSource annotationSource,
FeatureType featureType,
int genomicStartLocation,
int genomicEndLocation,
GenomicStrand genomicStrand,
GenomicPhase genomicPhase,
String geneId,
String transcriptId,
GeneTranscriptType geneType,
GeneTranscriptStatus geneStatus,
String geneName,
GeneTranscriptType transcriptType,
GeneTranscriptStatus transcriptStatus,
String transcriptName,
int exonNumber,
String exonId,
LocusLevel locusLevel,
ArrayList<OptionalField<?>> optionalFields,
String anonymousOptionalFields) {

super(featureOrderNumber, chromosomeName, annotationSource, featureType, genomicStartLocation, genomicEndLocation, genomicStrand, genomicPhase, geneId, transcriptId, geneType, geneStatus, geneName, transcriptType, transcriptStatus, transcriptName, exonNumber, exonId, locusLevel, optionalFields, anonymousOptionalFields);
}

public static GencodeGtfFeature create(long featureOrderNumber,
String chromosomeName,
AnnotationSource annotationSource,
FeatureType featureType,
int genomicStartLocation,
int genomicEndLocation,
GenomicStrand genomicStrand,
GenomicPhase genomicPhase,
String geneId,
String transcriptId,
GeneTranscriptType geneType,
GeneTranscriptStatus geneStatus,
String geneName,
GeneTranscriptType transcriptType,
GeneTranscriptStatus transcriptStatus,
String transcriptName,
int exonNumber,
String exonId,
LocusLevel locusLevel,
ArrayList<OptionalField<?>> optionalFields,
String anonymousOptionalFields) {

return new GencodeGtfCDSFeature(featureOrderNumber, chromosomeName, annotationSource, featureType, genomicStartLocation, genomicEndLocation, genomicStrand, genomicPhase, geneId, transcriptId, geneType, geneStatus, geneName, transcriptType, transcriptStatus, transcriptName, exonNumber, exonId, locusLevel, optionalFields, anonymousOptionalFields);
}

}
Loading

0 comments on commit b12a3ef

Please sign in to comment.