1 """Code shared between test cases.
6 import htsworkflow.util.rdfhelp
8 S1_NAME = '1000-sample'
9 S2_NAME = '2000-sample'
12 os.path.join(S1_NAME, 'file1_l8_r1.fastq'),
13 os.path.join(S1_NAME, 'file1_l8_r2.fastq'),
17 os.path.join(S2_NAME, 'file1.bam'),
18 os.path.join(S2_NAME, 'file1_l5.fastq'),
21 TURTLE_PREFIX = htsworkflow.util.rdfhelp.get_turtle_header()
23 S1_TURTLE = TURTLE_PREFIX + """
24 <http://localhost/library/1000/>
25 htswlib:cell_line "Cell1000" ;
26 htswlib:library_id "1000" ;
27 htswlib:library_type "Single" ;
28 htswlib:replicate "1" ;
29 htswlib:has_lane <http://localhost/lane/1> ;
30 a htswlib:IlluminaLibrary .
32 <http://localhost/lane/1>
33 htswlib:flowcell <http://localhost/flowcel/1234ABXXX> ;
34 htswlib:lane_number "1"@en;
35 a htswlib:IlluminaLane .
38 S2_TURTLE = TURTLE_PREFIX + """
39 <http://localhost/library/2000/>
40 htswlib:cell_line "Cell2000" ;
41 htswlib:library_id "2000" ;
42 htswlib:library_type "Paired End (non-multiplexed)" ;
43 htswlib:replicate "2" ;
44 htswlib:has_lane <http://localhost/lane/2> ;
47 <http://localhost/lane/2>
48 htswlib:flowcell <http://localhost/flowcel/1234ABXXX> ;
49 htswlib:lane_number "2"@en ;
50 a htswlib:IlluminaLane .
53 class MockAddDetails(object):
54 def __init__(self, model, turtle=None):
57 self.add_turtle(turtle)
59 def add_turtle(self, turtle):
60 parser = RDF.Parser('turtle')
61 parser.parse_string_into_model(self.model, turtle, "http://localhost")
63 def __call__(self, libNode):
64 q = RDF.Statement(libNode, None, None)
66 for s in self.model.find_statements(q):