예제 #1
0
def test_export_ol_no_map_tab_path():
    """Test export"""
    i = Index('test/data/index_oneline.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export(map=None, export_type='tab', tags=['path'])
    assert exp[0] == 'aWL3.2/aWL3.2_4204_ACTGAT_transcript.gtf'
예제 #2
0
def test_export_ol_no_map_tab_all():
    """Test export"""
    i = Index('test/data/index_oneline.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export(map=None, export_type='tab')
    assert exp[
        0] == '''ACTGAT(A)\tL3\tAR025\tanterior\trnaSeq\taWL3.2\t"5.8 ng/uL (30 nM) 08/04/2013"\tcell\t297\t37478754\tdmel\taWL3.2/aWL3.2_4204_ACTGAT_transcript.gtf\t2\tMATE1_SENSE\t2x75D\t2\tlongPolyA\t100\twing\tgtf\tTranscriptFB554'''
예제 #3
0
def test_export_oneline_no_map():
    """Test export one known line"""
    i = Index('test/data/index_oneline.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export(map=None)
    assert exp[
        0] == '''aWL3.2/aWL3.2_4204_ACTGAT_transcript.gtf\tadaptor=ACTGAT(A); age=L3; barcode=AR025; cell=anterior; dataType=rnaSeq; labExpId=aWL3.2; libBio="5.8 ng/uL (30 nM) 08/04/2013"; localization=cell; maxPeak=297; nReads=37478754; organism=dmel; poolId=2; readStrand=MATE1_SENSE; readType=2x75D; replicate=2; rnaExtract=longPolyA; rnaQuantity=100; tissue=wing; type=gtf; view=TranscriptFB554;'''
예제 #4
0
def test_export_oneline():
    """Test export one known line"""
    i = Index('test/data/index_oneline.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export()
    assert exp[
        0] == '''aWL3.2/aWL3.2_4204_ACTGAT_transcript.gtf\tLIBRARY_ID=aWL3.2; RNA_quantity=100; barcode=AR025; cell=anterior; dataType=rnaSeq; developmental_point=L3; library_Bioanalyser="5.8 ng/uL (30 nM) 08/04/2013"; localization=cell; max_peak=297; n_sequences=37478754; organism=dmel; pool_ID=2; readStrand=MATE1_SENSE; readType=2x75D; replicate=2; rnaExtract=longPolyA; sequence=ACTGAT(A); tissue=wing; type=gtf; view=TranscriptFB554;'''
예제 #5
0
def test_export_no_map():
    """Test export"""
    i = Index('test/data/index.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export(map=None)
    assert len(exp) == 216
    assert 'labExpId' in exp[0]
    assert 'fileinfo' not in exp[0]
예제 #6
0
def test_export():
    """Test export"""
    i = Index('test/data/index.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export()
    assert type(exp) == list
    assert len(exp) == 216
    assert 'LIBRARY_ID' in exp[0]
예제 #7
0
def test_export_ol_no_map_tab_all_header():
    """Test export"""
    i = Index('test/data/index_oneline.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export(map=None, export_type='tab', header=True)
    assert exp[
        0] == 'adaptor\tage\tbarcode\tcell\tdataType\tlabExpId\tlibBio\tlocalization\tmaxPeak\tnReads\torganism\tpath\tpoolId\treadStrand\treadType\treplicate\trnaExtract\trnaQuantity\ttissue\ttype\tview'
    assert exp[
        1] == '''ACTGAT(A)\tL3\tAR025\tanterior\trnaSeq\taWL3.2\t"5.8 ng/uL (30 nM) 08/04/2013"\tcell\t297\t37478754\tdmel\taWL3.2/aWL3.2_4204_ACTGAT_transcript.gtf\t2\tMATE1_SENSE\t2x75D\t2\tlongPolyA\t100\twing\tgtf\tTranscriptFB554'''
예제 #8
0
def test_export_no_format_no_map():
    """Test export"""
    i = Index()
    #assert i is not None
    i.insert(id="myId",
             path="test/data/index.txt",
             type="text",
             view="TxtFile")
    exp = i.export(map=None, export_type='tab', tags=['id'])
    assert len(exp) == 1
    assert exp[0] == 'myId'
예제 #9
0
def test_export_ol_no_map_tab_repeated_tags_header():
    """Test export"""
    i = Index('test/data/index_oneline.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export(map=None,
                   export_type='tab',
                   tags=['id', 'id', 'path'],
                   header=True)
    assert exp[0] == 'labExpId\tlabExpId\tpath'
    assert exp[1] == 'aWL3.2\taWL3.2\taWL3.2/aWL3.2_4204_ACTGAT_transcript.gtf'
예제 #10
0
def test_export_no_map_tab_path_template():
    """Test export tab output with path template"""
    i = Index('test/data/index.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export(map=None,
                   export_type='tab',
                   tags=['path', '{dirname}/{id}.{view}.{ext}'],
                   hide_missing=True)
    assert len(exp) == 200
    assert exp[
        0] == '/users/rg/epalumbo/projects/ERC/fly/bp.pipeline/EL3.1/EL3.1_5355_ATCACG.minusRaw.bigwig\t/users/rg/epalumbo/projects/ERC/fly/bp.pipeline/EL3.1/EL3.1.MinusRawSignal.bigwig'
예제 #11
0
def test_export_no_map_tab_repeated_tags():
    """Test export tab output with repeated tags"""
    i = Index('test/data/index.txt')
    assert i is not None
    i.set_format('test/data/format.json')
    i.open()
    exp = i.export(map=None,
                   export_type='tab',
                   tags=['id', 'id', 'path'],
                   hide_missing=True)
    assert len(exp) == 200
    assert exp[
        0] == 'EL3.1\tEL3.1\t/users/rg/epalumbo/projects/ERC/fly/bp.pipeline/EL3.1/EL3.1_5355_ATCACG.minusRaw.bigwig'
예제 #12
0
def test_add_file_external():
    index = '''.\tage=-; cell=Neutrophils; dataType=RNA-Seq; dateSubmittedFirst=2012-10-17T09:49:23+0200; donorId=C000XW; ethnicity=NA; lab=MPIMG; labExpId=ERR180946; labProtocolId=C000XWB1; libProtocol=I_bc_pelib_858; localization="Primary Cell"; quality=phred; readStrand=MATE2_SENSE; readType=2x76D; rnaExtract=total; seqPlatform=ILLUMINA; seqRun=1; sex=Male; sraSampleAccession=ERS150362; sraStudyAccession=ERP001664; tissue="Cord blood";'''
    i = Index()
    i.set_format('test/data/tsv_format.json')
    i.insert(**Index.parse_line(index, **i.format))
    i.insert(
        id="ERR180946",
        path=
        "/users/rg/epalumbo/projects/BluePrint/reads/20130805/data/ERR180946_1.fastq.gz",
        view="FastqRd1",
        type="fastq")
    assert i.export(
        map=None
    )[0] == '''/users/rg/epalumbo/projects/BluePrint/reads/20130805/data/ERR180946_1.fastq.gz\tage=-; cell=Neutrophils; dataType=RNA-Seq; dateSubmittedFirst=2012-10-17T09:49:23+0200; donorId=C000XW; ethnicity=NA; lab=MPIMG; labExpId=ERR180946; labProtocolId=C000XWB1; libProtocol=I_bc_pelib_858; localization="Primary Cell"; quality=phred; readStrand=MATE2_SENSE; readType=2x76D; rnaExtract=total; seqPlatform=ILLUMINA; seqRun=1; sex=Male; sraSampleAccession=ERS150362; sraStudyAccession=ERP001664; tissue="Cord blood"; type=fastq; view=FastqRd1;'''