コード例 #1
0
def publish():
    '''publish files.'''
    # publish web pages

    P.publish_report()

    # publish additional data
    web_dir = PARAMS["web_dir"]
    project_id = P.getProjectId()

    # directory, files
    exportfiles = {
        "intervals": glob.glob(os.path.join(
            PARAMS["exportdir"], "bed", "*.bed.gz")) +
        glob.glob(os.path.join(PARAMS["exportdir"], "bed", "*.bed.gz.tbi")),
    }

    bams = []

    for targetdir, filenames in exportfiles.iteritems():
        if len(filenames) == 0:
            E.warn("no files for target '%s'" % targetdir)
        for src in filenames:
            dest = "%s/%s/%s" % (web_dir, targetdir, os.path.basename(src))
            if dest.endswith(".bam"):
                bams.append(dest)
            dest = os.path.abspath(dest)
            destdir = os.path.dirname(dest)
            if not os.path.exists(destdir):
                os.makedirs(destdir)

            if not os.path.exists(dest):
                E.debug("creating symlink from %s to %s" % (src, dest))
                os.symlink(os.path.abspath(src), dest)
コード例 #2
0
ファイル: pipeline_motifs.py プロジェクト: wbyu/CGATPipelines
def publish():
    '''publish files.'''
    # publish web pages

    P.publish_report()

    # publish additional data
    web_dir = PARAMS["web_dir"]
    project_id = P.getProjectId()

    # directory, files
    exportfiles = {
        "intervals":
        glob.glob(os.path.join(PARAMS["exportdir"], "bed", "*.bed.gz")) +
        glob.glob(os.path.join(PARAMS["exportdir"], "bed", "*.bed.gz.tbi")),
    }

    bams = []

    for targetdir, filenames in exportfiles.items():
        if len(filenames) == 0:
            E.warn("no files for target '%s'" % targetdir)
        for src in filenames:
            dest = "%s/%s/%s" % (web_dir, targetdir, os.path.basename(src))
            if dest.endswith(".bam"):
                bams.append(dest)
            dest = os.path.abspath(dest)
            destdir = os.path.dirname(dest)
            if not os.path.exists(destdir):
                os.makedirs(destdir)

            if not os.path.exists(dest):
                E.debug("creating symlink from %s to %s" % (src, dest))
                os.symlink(os.path.abspath(src), dest)
コード例 #3
0
def publish():
    '''publish files.'''
    # publish web pages
    patterns = [(re.compile("/ifs/projects/proj012/report/html"),
                 "http://www.cgat.org/downloads/KW0ok5WWly/report"),
                ]

    P.publish_report(patterns=patterns)
コード例 #4
0
def publish():
    '''publish files.'''
    # publish web pages
    patterns = [
        (re.compile("/ifs/projects/proj012/report/html"),
         "http://www.cgat.org/downloads/KW0ok5WWly/report"),
    ]

    P.publish_report(patterns=patterns)
コード例 #5
0
def publish():
    '''publish files.'''
    # publish web pages
    P.publish_report()

    # publish additional data - i.e. the final lncRNA gtf file
    web_dir = PARAMS["web_dir"]

    if not os.path.exists(os.path.join(web_dir), "lncrna_final.class.gtf.gz"):
        os.symlink("lncrna_final.class.gtf.gz", os.path.abspath(
            os.path.join(os.path.join(web_dir), "lncrna_final.class.gtf.gz")))
コード例 #6
0
def publish():
    '''publish files.'''
    # publish web pages
    P.publish_report()

    # publish additional data - i.e. the final lncRNA gtf file
    web_dir = PARAMS["web_dir"]

    if not os.path.exists(os.path.join(web_dir), "lncrna_final.class.gtf.gz"):
        os.symlink("lncrna_final.class.gtf.gz", os.path.abspath(
            os.path.join(os.path.join(web_dir), "lncrna_final.class.gtf.gz")))
コード例 #7
0
def publish():
    '''publish files.'''

    # publish web pages
    P.publish_report()

    # publish additional data
    web_dir = PARAMS["web_dir"]
    project_id = P.getProjectId()

    ucsc_urls = {
        "bam":
        """track type=bam name="%(track)s" bigDataUrl=http://www.cgat.org/downloads/%(project_id)s/%(dirname)s/%(filename)s""",
        "bigwig":
        """track type=bigWig name="%(track)s" bigDataUrl=http://www.cgat.org/downloads/%(project_id)s/%(dirname)s/%(filename)s""",
    }

    # directory, files
    exportfiles = (
        ("bamfiles", glob.glob("*/*.genome.bam") +
         glob.glob("*/*.genome.bam.bai"), "bam"),
        ("bamfiles", glob.glob("*/*.prep.bam") +
         glob.glob("*/*.prep.bam.bai"), "bam"),
        ("medips", glob.glob("*/*.bigwig"), "bigwig"),
    )

    ucsc_files = []

    for targetdir, filenames, datatype in exportfiles:
        for src in filenames:
            filename = os.path.basename(src)
            dest = "%s/%s/%s" % (web_dir, targetdir, filename)
            suffix = os.path.splitext(src)
            if suffix in ucsc_urls:
                ucsc_files.append((datatype, targetdir, filename))
            dest = os.path.abspath(dest)
            if not os.path.exists(dest):
                os.symlink(os.path.abspath(src), dest)

    # output ucsc links
    for ucsctype, dirname, filename in ucsc_files:
        filename = os.path.basename(filename)
        track = P.snip(filename, ucsctype)
        print(ucsc_urls[ucsctype] % locals())
コード例 #8
0
def publish():
    '''publish files.'''

    # publish web pages
    P.publish_report()

    # publish additional data
    web_dir = PARAMS["web_dir"]
    project_id = P.getProjectId()

    ucsc_urls = {
        "bam":
        """track type=bam name="%(track)s" bigDataUrl=http://www.cgat.org/downloads/%(project_id)s/%(dirname)s/%(filename)s""",
        "bigwig":
        """track type=bigWig name="%(track)s" bigDataUrl=http://www.cgat.org/downloads/%(project_id)s/%(dirname)s/%(filename)s""",
    }

    # directory, files
    exportfiles = (
        ("bamfiles",
         glob.glob("*/*.genome.bam") + glob.glob("*/*.genome.bam.bai"), "bam"),
        ("bamfiles", glob.glob("*/*.prep.bam") + glob.glob("*/*.prep.bam.bai"),
         "bam"),
        ("medips", glob.glob("*/*.bigwig"), "bigwig"),
    )

    ucsc_files = []

    for targetdir, filenames, datatype in exportfiles:
        for src in filenames:
            filename = os.path.basename(src)
            dest = "%s/%s/%s" % (web_dir, targetdir, filename)
            suffix = os.path.splitext(src)
            if suffix in ucsc_urls:
                ucsc_files.append((datatype, targetdir, filename))
            dest = os.path.abspath(dest)
            if not os.path.exists(dest):
                os.symlink(os.path.abspath(src), dest)

    # output ucsc links
    for ucsctype, dirname, filename in ucsc_files:
        filename = os.path.basename(filename)
        track = P.snip(filename, ucsctype)
        print(ucsc_urls[ucsctype] % locals())
コード例 #9
0
def publish():
    '''publish files.'''

    # directory, files

    export_files = {"bigwigfiles": glob.glob("*/*.bigwig")}

    if PARAMS['ucsc_exclude']:
        for filetype, files in export_files.items():
            new_files = set(files)
            for f in files:
                for regex in P.asList(PARAMS['ucsc_exclude']):
                    if re.match(regex, f):
                        new_files.remove(f)
                        break

            export_files[filetype] = list(new_files)

    # publish web pages
    E.info("publishing report")
    P.publish_report(export_files=export_files)

    E.info("publishing UCSC data hub")
    P.publish_tracks(export_files)
コード例 #10
0
def publish():
    '''publish files.'''
    P.publish_report()
コード例 #11
0
def publish():
    '''publish report and data.'''

    E.info("publishing report")
    P.publish_report()
コード例 #12
0
def publish():
    '''publish files.'''
    # publish web pages

    P.publish_report()
コード例 #13
0
def publish():
    """publish files."""
    P.publish_report()
コード例 #14
0
def publish_report():
    """publish report."""

    E.info("publishing report")
    P.publish_report()
コード例 #15
0
def publish_report():
    """publish report in the CGAT downloads directory."""

    E.info("publishing report")
    P.publish_report()
コード例 #16
0
def publish():
    '''publish report and data.'''

    E.info( "publishing report" )
    P.publish_report()
コード例 #17
0
def publish_report():
    '''publish report in the CGAT downloads directory.'''

    E.info("publishing report")
    P.publish_report()
コード例 #18
0
def publish_report():
    '''publish report.'''

    E.info("publishing report")
    P.publish_report()
コード例 #19
0
    This will update a report with any changes inside the report
    document or code. Note that updates to the data will not cause
    relevant sections to be updated. Use the cgatreport-clean utility
    first.
    '''

    E.info("updating report")
    P.run_report(clean=False)


@follows(update_report)
def publish_report():
    '''publish report in the CGAT downloads directory.'''

    E.info("publishing report")
    P.publish_report()

##################################################################
# ---------------------------------------------------
# See Steve's way of reporting:
# https://github.com/snsansom/scseq/blob/master/pipelines/pipeline_scrnaseq.py

# --------------------- < generic pipeline tasks > -------------------------- #

'''
@follows(mkdir("notebook.dir"))
@transform(glob.glob(os.path.join(os.path.dirname(__file__),
                                  "pipeline_notebooks",
                                  os.path.basename(__file__)[:-len(".py")],
                                  "*")),
           regex(r".*/(.*)"),
コード例 #20
0
def publish_report():
    '''publish report in the CGAT downloads directory.'''

    E.info("publishing report")
    P.publish_report()
コード例 #21
0
def publish():
    '''publish files.'''
    P.publish_report()
コード例 #22
0
def publish_report():
    '''publish report.'''

    E.info("publishing report")
    P.publish_report()
コード例 #23
0
def publish():
    '''publish files.'''

    # publish web pages
    P.publish_report()