Esempio n. 1
0
def _prep_bam_input(f, i, base):
    if not os.path.exists(f):
        raise ValueError("Could not find input file: %s" % f)
    cur = copy.deepcopy(base)
    cur["files"] = [os.path.abspath(f)]
    cur["description"] = sample_name(f) or os.path.splitext(os.path.basename(f))[0]
    return cur
Esempio n. 2
0
def _prep_bam_input(f, i, base):
    if not os.path.exists(f):
        raise ValueError("Could not find input file: %s" % f)
    cur = copy.deepcopy(base)
    cur["files"] = [os.path.abspath(f)]
    cur["description"] = ((sample_name(f) if f.endswith(".bam") else None)
                          or os.path.splitext(os.path.basename(f))[0])
    return cur
Esempio n. 3
0
def _get_bam_samples(f, data):
    have_full_file = False
    if have_full_file:
        return [bam.sample_name(f)]
    else:
        if os.path.basename(f).startswith("%s-" % dd.get_sample_name(data)):
            return [dd.get_sample_name(data)]
        else:
            return []
Esempio n. 4
0
def _get_bam_samples(f, items):
    have_full_file = False
    if have_full_file:
        return [bam.sample_name(f)]
    else:
        for data in items:
            if os.path.basename(f).startswith(("%s-" % dd.get_sample_name(data),
                                               "%s." % dd.get_sample_name(data))):
                return [dd.get_sample_name(data)]
        return []
Esempio n. 5
0
def _get_bam_samples(f, items):
    have_full_file = False
    if have_full_file:
        return [bam.sample_name(f)]
    else:
        for data in items:
            if os.path.basename(f).startswith(("%s-" % dd.get_sample_name(data),
                                               "%s." % dd.get_sample_name(data))):
                return [dd.get_sample_name(data)]
        return []
Esempio n. 6
0
def _prep_bam_input(f, i, base):
    if not os.path.exists(f) and not objectstore.is_remote(f):
        raise ValueError("Could not find input file: %s" % f)
    cur = copy.deepcopy(base)
    if objectstore.is_remote(f):
        cur["files"] = [f]
        cur["description"] = os.path.splitext(os.path.basename(f))[0]
    else:
        cur["files"] = [os.path.abspath(f)]
        cur["description"] = ((sample_name(f) if f.endswith(".bam") else None)
                              or os.path.splitext(os.path.basename(f))[0])
    return cur
Esempio n. 7
0
def _get_bam_samples(f):
    return [bam.sample_name(f)]