Exemple #1
0
def RNACohort(RNAAccession1, RNAAccession2):
    FreezableAPI.delete("Cohort", "RNACohort")
    x = Cohort("RNACohort")
    x.add_accession(RNAAccession1)
    x.add_accession(RNAAccession2)
    yield x
    FreezableAPI.delete(x.m80.dtype, x.m80.name)
Exemple #2
0
def test_delete_m80():
    import os
    from minus80.Tools import delete
    c = Cohort('DeleteMe')
    dbFile = c._get_dbpath('db.sqlite')
    assert os.path.exists(dbFile) == True
    delete('Cohort','DeleteMe',force=True)
    assert os.path.exists(dbFile) == False
Exemple #3
0
def test_delete_m80():
    import os
    from minus80.Tools import delete
    c = Cohort('DeleteMe')
    dbFile = c._get_dbpath('db.sqlite')
    assert os.path.exists(dbFile) == True
    delete('Cohort', 'DeleteMe', force=True)
    assert os.path.exists(dbFile) == False
Exemple #4
0
def test_delete_missing():
    import os
    from minus80.Tools import delete
    c = Cohort('DeleteMe')
    dbFile = c._get_dbpath('db.sqlite')
    assert os.path.exists(dbFile) == True
    # Giving the wrong information shouldnt do anything
    delete('Cohort', 'DeleteMeee', force=True)
    assert os.path.exists(dbFile) == True
    delete('Cohort', 'DeleteMe', force=True)
    assert os.path.exists(dbFile) == False
Exemple #5
0
def test_delete_missing():
    import os
    from minus80.Tools import delete
    c = Cohort('DeleteMe')
    dbFile = c._get_dbpath('db.sqlite')
    assert os.path.exists(dbFile) == True
    # Giving the wrong information shouldnt do anything
    delete('Cohort','DeleteMeee',force=True)
    assert os.path.exists(dbFile) == True
    delete('Cohort','DeleteMe',force=True)
    assert os.path.exists(dbFile) == False
Exemple #6
0
def simpleCohort():
    delete("Cohort", "TestCohort", force=True)
    # Create the simple cohort
    a = Accession("Sample1", files=["file1.txt", "file2.txt"], type="WGS")
    b = Accession("Sample2", files=["file1.txt", "file2.txt"], type="WGS")
    c = Accession("Sample3", files=["file1.txt", "file2.txt"], type="CHIP")
    d = Accession("Sample4", files=["file1.txt", "file2.txt"], type="CHIP")

    x = Cohort("TestCohort")
    for acc in [a, b, c, d]:
        x.add_accession(acc)
    return x
Exemple #7
0
def simpleCohort():
    delete('Cohort', 'TestCohort', force=True)
    # Create the simple cohort
    a = Accession('Sample1', files=['file1.txt', 'file2.txt'], type='WGS')
    b = Accession('Sample2', files=['file1.txt', 'file2.txt'], type='WGS')
    c = Accession('Sample3', files=['file1.txt', 'file2.txt'], type='CHIP')
    d = Accession('Sample4', files=['file1.txt', 'file2.txt'], type='CHIP')

    x = Cohort('TestCohort')
    for acc in [a, b, c, d]:
        x.add_accession(acc)
    return x
Exemple #8
0
def simpleCohort():
    delete('Cohort','TestCohort',force=True)
    # Create the simple cohort
    a = Accession('Sample1',files=['file1.txt','file2.txt'],type='WGS')
    b = Accession('Sample2',files=['file1.txt','file2.txt'],type='WGS')
    c = Accession('Sample3',files=['file1.txt','file2.txt'],type='CHIP')
    d = Accession('Sample4',files=['file1.txt','file2.txt'],type='CHIP')

    x = Cohort('TestCohort')
    for acc in [a,b,c,d]:
        x.add_accession(acc)
    return x
Exemple #9
0
def simpleCohort():
    FreezableAPI.delete("Cohort", "TestCohort")
    # Create the simple cohort
    a = Accession("Sample1", files=["file1.txt", "file2.txt"], type="WGS")
    b = Accession("Sample2", files=["file1.txt", "file2.txt"], type="WGS")
    c = Accession("Sample3", files=["file1.txt", "file2.txt"], type="CHIP")
    d = Accession("Sample4", files=["file1.txt", "file2.txt"], type="CHIP")

    x = Cohort("TestCohort")
    for acc in [a, b, c, d]:
        x.add_accession(acc)
    yield x
    FreezableAPI.delete(x.m80.dtype, x.m80.name)
Exemple #10
0
def test_delete_m80():

    c = Cohort("DeleteMe")
    dbFile = os.path.join(c.m80.thawed_dir, "db.sqlite")
    assert os.path.exists(dbFile) == True
    FreezableAPI.delete("Cohort", "DeleteMe")
    assert os.path.exists(dbFile) == False
Exemple #11
0
def test_delete_m80():
    import os
    from minus80.Tools import delete

    c = Cohort("DeleteMe")
    dbFile = os.path.join(c.m80.basedir, "db.sqlite")
    assert os.path.exists(dbFile) == True
    delete("Cohort", "DeleteMe", force=True)
    assert os.path.exists(dbFile) == False
Exemple #12
0
def test_delete_missing():

    c = Cohort("DeleteMe")
    dbFile = os.path.join(c.m80.thawed_dir, "db.sqlite")
    assert os.path.exists(dbFile) == True
    # Giving the wrong information shouldnt do anything
    FreezableAPI.delete("Cohort", "DeleteMeee")
    assert os.path.exists(dbFile) == True
    FreezableAPI.delete("Cohort", "DeleteMe")
    assert os.path.exists(dbFile) == False
Exemple #13
0
def test_delete_missing():
    import os
    from minus80.Tools import delete

    c = Cohort("DeleteMe")
    dbFile = os.path.join(c.m80.basedir, "db.sqlite")
    assert os.path.exists(dbFile) == True
    # Giving the wrong information shouldnt do anything
    delete("Cohort", "DeleteMeee", force=True)
    assert os.path.exists(dbFile) == True
    delete("Cohort", "DeleteMe", force=True)
    assert os.path.exists(dbFile) == False
Exemple #14
0
def RNACohort(RNAAccession1, RNAAccession2):
    delete("Cohort", "RNACohort", force=True)
    x = Cohort("RNACohort")
    x.add_accession(RNAAccession1)
    x.add_accession(RNAAccession2)
    return x
Exemple #15
0
def test_from_accessions():
    a = Accession("Sample1", files=["file1.txt", "file2.txt"], type="WGS")
    b = Accession("Sample2", files=["file1.txt", "file2.txt"], type="WGS")
    c = Accession("Sample3", files=["file1.txt", "file2.txt"], type="CHIP")
    d = Accession("Sample4", files=["file1.txt", "file2.txt"], type="CHIP")
    Cohort.from_accessions("TestCohort", [a, b, c, d])
Exemple #16
0
def test_init_different_rootdir():
    tmpdir = tempfile.TemporaryDirectory()
    x = Cohort("tmpCohort", rootdir=tmpdir.name)
    assert str(x.m80.basedir).startswith(tmpdir.name)
Exemple #17
0
def test_from_accessions():
    a = Accession('Sample1', files=['file1.txt', 'file2.txt'], type='WGS')
    b = Accession('Sample2', files=['file1.txt', 'file2.txt'], type='WGS')
    c = Accession('Sample3', files=['file1.txt', 'file2.txt'], type='CHIP')
    d = Accession('Sample4', files=['file1.txt', 'file2.txt'], type='CHIP')
    x = Cohort.from_accessions('TestCohort', [a, b, c, d])
Exemple #18
0
def test_from_accessions():
    a = Accession('Sample1',files=['file1.txt','file2.txt'],type='WGS')
    b = Accession('Sample2',files=['file1.txt','file2.txt'],type='WGS')
    c = Accession('Sample3',files=['file1.txt','file2.txt'],type='CHIP')
    d = Accession('Sample4',files=['file1.txt','file2.txt'],type='CHIP')
    x = Cohort.from_accessions('TestCohort',[a,b,c,d])
Exemple #19
0
def RNACohort(RNAAccession1, RNAAccession2):
    delete('Cohort', 'RNACohort', force=True)
    x = Cohort('RNACohort')
    x.add_accession(RNAAccession1)
    x.add_accession(RNAAccession2)
    return x
Exemple #20
0
def RNACohort(RNAAccession1,RNAAccession2):
    delete('Cohort','RNACohort',force=True)
    x = Cohort('RNACohort')
    x.add_accession(RNAAccession1)
    x.add_accession(RNAAccession2)
    return x