Package: gdc-readgroups
gdc-readgroupsPurposeThis package will extract the Read Group header lines from a BAM file, and convert the contained metadata to a json or tsv file with appropriate values applied for creation of a Read Group node in theNCI's Genomic Data Commons(GDC). Optionally, it will take no input, and output a template which may be edited to create a submission to the GDC.The generated file may contain some fields markedREQUIRED<type>, which indicates these fields could not be generated from the supplied BAM file. In this case, the user must apply their own desired values to the generated json. The<type>must be as indicated in the generated json file. For details, see the columnAcceptable Types or Valuesat theGDC Data Dictionary Viewer.Other fields are optional, and are markedOPTIONAL<type>. If these fields could not be generated from the supplied BAM file, they may be filled in as appropriate or removed.NoteThe tool will only run on complete BAM files - files which contain the suffix.bam.If the BAM is truncated, the errorOSError: no BGZF EOF marker; file may be truncatedwill be generated, and no json will be produced.InstallationThere are 2 ways to installgdc-readgroupspip install from pypigdc-readgroupsmay be used as apipinstalled python package.If you would like to install the package as root, for all users, runsudopipinstallgdc-readgroupsIf you would like to install the package only for a local user, runpipinstallgdc-readgroups--userBuild a Docker ImageThe github repository for this package contains a Dockerfile, which may be used to build an image containing the package and all prerequisites. There are two ways to build the image.Usingdockerdirectly.wgethttps://raw.githubusercontent.com/NCI-GDC/gdc-readgroups/master/Dockerfile
dockerbuild-tgdc-readgroups.Usingcwltoolto build an image, and then run it, in one command.In this case the cwl tool will expect a BAM input, and produce a json output. To install the reference CWL engine, runpipinstallcwltool--userThen to build thegdc-readgroupsDocker Image and run the Container, runwgethttps://raw.githubusercontent.com/NCI-GDC/gdc-readgroups/master/Dockerfile
wgethttps://raw.githubusercontent.com/NCI-GDC/gdc-readgroups/master/gdc-readgroups.cwl
cwltoolgdc-readgroups.cwl--INPUT<yourbamfile>The above command will only build the Docker Image if it does not exist on the system. After the build is performed once, the image will remain on your system, and the nextcwltoolrun will skip the build step.Usagegdc-readgroupshas two main modes:bam-modeandtemplate-mode.bam-modeInbam-mode, a path to a BAM file must be supplied as input. By default,bam-modewill output a json file, but optionally may output a tsv file.The command to run thepip installed packageisgdc-readgroupsbam-mode--bam_path<yourbamfile>The generated json will be placed in the current working directory and have a filename of<bam basename>.json.
Any error messages will be written to stdout.To output a tsv file, rungdc-readgroupsbam-mode--bam_path<yourbamfile>--output-formattsvThe generated tsv file will be placed in your current working directory, and be of the form<bam basename>.tsvtemplate-modeIntemplate-mode, no input is supplied, and two empty records are output within one file, either in json or tsv format.To generate a json template, rungdc-readgroupstemplate-modeThe output will be placed in the current working directory and have a filename ofgdc_readgroups.jsonTo generate a tsv template, rungdc-readgroupstemplate-mode--output-formattsvThe output will be placed in the current working directory and have a filename ofgdc_readgroups.tsv