Arc39 / ga_to_vcf

Converts vcf_to_ga files back into VCF
2 stars 1 forks source link

Incorporate into python client #1

Open david4096 opened 7 years ago

david4096 commented 7 years ago

When we have something worth sharing this is where this functionality should land: https://github.com/ga4gh/server/blob/master/ga4gh/server/converters.py#L251

Arc39 commented 7 years ago
    def writeHeader(self):
        variantSet = self._container
        outputFile = self._outputFile
        outputFile.write("##fileformat=VCFv4.1")
        outputFile.write("##datasetid={datasetid}".format(datasetid=variantSet.dataset_id))
        outputFile.write("##variantSetId={id}".format(id=variantSet.id))

        for metadata in variantSet.metadata:
            outputFile.write("##INFO=<ID={key}".format(key=metadata.key),"Number={number}".format(number=metadata.number),"Type={type}".format(type=metadata.type),"Description={description}".format(description=metadata.description),"Info={info}".format(info=metadata.info),"value={value}".format(value=metadata.value))
        outputFile.write("#CHROM POS ID REF ALT QUAL FILTER INFO")

Okay, here is what I have for the writeHeader function. The output seems correct to me.

david4096 commented 7 years ago

Cool, if you move your code over to the reference server you can run it using the client. It will be easier to compare and test your results there since it has an entry point and all the CLI connections to the client made.