Example #1
0
 # Default values - the order in which we attempt to determine data types is critical
 # because some formats are much more flexibly defined than others.
 if len(self.sniff_order) < 1:
     self.sniff_order = [
         binary.Bam(),
         binary.Sff(),
         xml.GenericXml(),
         sequence.Maf(),
         sequence.Lav(),
         sequence.csFasta(),
         qualityscore.QualityScoreSOLiD(),
         qualityscore.QualityScore454(),
         sequence.Fasta(),
         sequence.Fastq(),
         interval.Wiggle(),
         images.Html(),
         sequence.Axt(),
         interval.Bed(), 
         interval.CustomTrack(),
         interval.Gtf(),
         interval.Gff(),
         interval.Gff3(),
         tabular.Pileup(),
         interval.Interval(),
         tabular.Sam(),
         tabular.Eland()
     ]
 def append_to_sniff_order():
     # Just in case any supported data types are not included in the config's sniff_order section.
     for ext in self.datatypes_by_extension:
         datatype = self.datatypes_by_extension[ext]
Example #2
0
    'data': data.Data(),
    'bed': interval.Bed(),
    'txt': data.Text(),
    'text': data.Text(),
    'interval': interval.Interval(),
    'tabular': interval.Tabular(),
    'png': images.Image(),
    'pdf': images.Image(),
    'fasta': sequence.Fasta(),
    'maf': sequence.Maf(),
    'axt': sequence.Axt(),
    'gff': interval.Gff(),
    'gmaj.zip': images.Gmaj(),
    'laj': images.Laj(),
    'lav': sequence.Lav(),
    'html': images.Html()
}


def get_datatype_by_extension(ext):
    """
    Returns a datatype based on an extension
    """
    try:
        builder = datatypes_by_extension[ext]
    except KeyError:
        builder = data.Text()
        log.warning('unkown extension in data factory %s' % ext)
    return builder