Example #1
0
    def _flagdownload(self):
        ## if download data do it and then exit. Runs single core in CLI. 
        if len(self.args.download) == 1:
            downloaddir = "sra-fastqs"
        else:
            downloaddir = self.args.download[1]

        # call the analysis tool
        import ipyrad.analysis as ipa
        sra = ipa.sratools(
            accessions=self.args.download[0],
            workdir=downloaddir,
        )

        # get run info and print spacer after
        df = sra.fetch_runinfo((1, 4, 6, 29, 30))
        print("")

        # rename spots for prettier printing and send to screen
        df.rename(columns={"spots_with_mates": "mates"}, inplace=True)
        print(df)

        # run download with default name_fields and separator
        sra.run(
            name_fields=(30, 1), 
            name_separator="_", 
            force=self.args.force,
            auto=True,
            show_cluster=True,
        )
        print("")
Example #2
0
def sratools_download(SRP, workdir='SRA_fastqs', force=False):
    import ipyrad.analysis as ipa
    sra = ipa.sratools(accession=SRP, workdir=workdir)

    ## get run info and print spacer after
    df = sra.fetch_runinfo((1,4,6,29,30))
    print("")

    ## rename spots for prettier printing and send to screen
    df.rename(columns={"spots_with_mates": "mates"}, inplace=True)
    print(df)

    ## run download with default name_fields and separator
    sra.run(name_fields=(30, 1), name_separator="_", force=force)
    print("")