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)
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
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
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
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
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
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
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
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)
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
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
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
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
def RNACohort(RNAAccession1, RNAAccession2): delete("Cohort", "RNACohort", force=True) x = Cohort("RNACohort") x.add_accession(RNAAccession1) x.add_accession(RNAAccession2) return x
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])
def test_init_different_rootdir(): tmpdir = tempfile.TemporaryDirectory() x = Cohort("tmpCohort", rootdir=tmpdir.name) assert str(x.m80.basedir).startswith(tmpdir.name)
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])
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])
def RNACohort(RNAAccession1, RNAAccession2): delete('Cohort', 'RNACohort', force=True) x = Cohort('RNACohort') x.add_accession(RNAAccession1) x.add_accession(RNAAccession2) return x
def RNACohort(RNAAccession1,RNAAccession2): delete('Cohort','RNACohort',force=True) x = Cohort('RNACohort') x.add_accession(RNAAccession1) x.add_accession(RNAAccession2) return x