Commit 3f15af76 authored by ckuchly's avatar ckuchly
Browse files

Add index information for sample declaration

parent 1a0a3f8c
...@@ -22,13 +22,14 @@ class Sample(object): ...@@ -22,13 +22,14 @@ class Sample(object):
AVAILABLE_TYPES = ["pe", "se", "ose", "ope", "mp"] AVAILABLE_TYPES = ["pe", "se", "ose", "ope", "mp"]
def __init__(self, sample_id, reads1, reads2 = None, name = None, description = None, type = None, def __init__(self, sample_id, reads1, reads2 = None,index = None, name = None, description = None, type = None,
insert_size = None, species = None, nb_sequences = None, full_size = None, id = None ): insert_size = None, species = None, nb_sequences = None, full_size = None, id = None ):
self.sample_id = sample_id self.sample_id = sample_id
self.name = name self.name = name
self.description = description self.description = description
self.reads1 = reads1 self.reads1 = reads1
self.reads2 = reads2 self.reads2 = reads2
self.index = index
self.insert_size = insert_size self.insert_size = insert_size
self.nb_sequences = nb_sequences self.nb_sequences = nb_sequences
self.full_size = full_size self.full_size = full_size
...@@ -41,6 +42,9 @@ class Sample(object): ...@@ -41,6 +42,9 @@ class Sample(object):
if isinstance(reads2, str) : if isinstance(reads2, str) :
self.reads2 = [reads2] self.reads2 = [reads2]
if isinstance(index, str) :
self.index = [index]
if self.type is None: if self.type is None:
if self.reads2 : if self.reads2 :
...@@ -94,12 +98,13 @@ class Sample(object): ...@@ -94,12 +98,13 @@ class Sample(object):
raise UnsavedRunError() raise UnsavedRunError()
def __str__(self, *args, **kwargs): def __str__(self, *args, **kwargs):
return "sid={sid}; name={name}; desc={desc}; r1={r1}; r2={r2}; insize={insize}; nbs={nbs}; fsize={fsize}; spec={spec}; t={t}".format( return "sid={sid}; name={name}; desc={desc}; r1={r1}; r2={r2}; i={i}; insize={insize}; nbs={nbs}; fsize={fsize}; spec={spec}; t={t}".format(
sid = self.sample_id or '', sid = self.sample_id or '',
name = self.name or '', name = self.name or '',
desc = self.description or '', desc = self.description or '',
r1 = self.reads1 or [], r1 = self.reads1 or [],
r2 = self.reads2 or [], r2 = self.reads2 or [],
i = self.index or [],
insize = self.insert_size or '', insize = self.insert_size or '',
nbs = self.nb_sequences or '', nbs = self.nb_sequences or '',
fsize = self.full_size or '', fsize = self.full_size or '',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment