Esempio n. 1
0
 def test_non_standard_sample_name_and_dual_barcode_with_plus(self):
     """IlluminaFastqAttrs: non-standard Fastq names with sample name and dual barcode using '+'
     """
     fq = IlluminaFastqAttrs('NH1_ChIP-seq.ACAGTG+GTTCAC.r2')
     self.assertEqual(fq.sample_name,'NH1_ChIP-seq')
     self.assertEqual(fq.basename,'NH1_ChIP-seq.ACAGTG+GTTCAC.r2')
     self.assertEqual(fq.extension,'')
     self.assertEqual(fq.sample_number,None)
     self.assertEqual(fq.barcode_sequence,'ACAGTG+GTTCAC')
     self.assertEqual(fq.lane_number,None)
     self.assertEqual(fq.read_number,2)
Esempio n. 2
0
 def test_non_standard_sample_name_and_barcode(self):
     """IlluminaFastqAttrs: non-standard Fastq names with sample name and barcode
     """
     fq = IlluminaFastqAttrs('NH1_ChIP-seq.ACAGTG.r2')
     self.assertEqual(fq.sample_name,'NH1_ChIP-seq')
     self.assertEqual(fq.basename,'NH1_ChIP-seq.ACAGTG.r2')
     self.assertEqual(fq.extension,'')
     self.assertEqual(fq.sample_number,None)
     self.assertEqual(fq.barcode_sequence,'ACAGTG')
     self.assertEqual(fq.lane_number,None)
     self.assertEqual(fq.read_number,2)
Esempio n. 3
0
 def test_index_read_blc2fastq2(self):
     """IlluminaFastqAttrs: Illumina index read fastq name from bcl2fastq2
     """
     fq = IlluminaFastqAttrs('NH1_ChIP-seq_Gli1_S4_L003_I1_001')
     self.assertEqual(fq.sample_name,'NH1_ChIP-seq_Gli1')
     self.assertEqual(fq.sample_number,4)
     self.assertEqual(fq.barcode_sequence,None)
     self.assertEqual(fq.lane_number,3)
     self.assertEqual(fq.read_number,1)
     self.assertEqual(fq.set_number,1)
     self.assertTrue(fq.is_index_read)
     self.assertEqual(str(fq),'NH1_ChIP-seq_Gli1_S4_L003_I1_001')
Esempio n. 4
0
 def test_non_standard_sample_name_with_dots(self):
     """IlluminaFastqAttrs: non-standard Fastq names with sample name containing dots
     """
     fq = IlluminaFastqAttrs('NH1.2.r2')
     self.assertEqual(fq.sample_name,'NH1.2')
     self.assertEqual(fq.basename,'NH1.2.r2')
     self.assertEqual(fq.extension,'')
     self.assertEqual(fq.sample_number,None)
     self.assertEqual(fq.barcode_sequence,None)
     self.assertEqual(fq.lane_number,None)
     self.assertEqual(fq.read_number,2)
     self.assertEqual(fq.set_number,None)
     self.assertEqual(str(fq),'NH1.2.r2')
Esempio n. 5
0
 def test_AGTC_sample_names(self):
     """IlluminaFastqAttrs: sample names consisting of letters 'A', 'G', 'T' and 'C'
     """
     for name in ('A','G','T','C','AGCT'):
         fq = IlluminaFastqAttrs('%s_R1' % name)
         self.assertEqual(fq.sample_name,name)
         self.assertEqual(fq.sample_number,None)
         self.assertEqual(fq.barcode_sequence,None)
         self.assertEqual(fq.lane_number,None)
         self.assertEqual(fq.read_number,1)
         self.assertEqual(fq.set_number,None)
         self.assertFalse(fq.is_index_read)
         self.assertEqual(str(fq),'%s_R1' % name)
Esempio n. 6
0
 def test_input_is_full_path(self):
     """IlluminaFastqAttrs: input as full path to Fastq file
     """
     fq = IlluminaFastqAttrs('/data/Project_NH/Sample_NH1/NH1_ChIP-seq_Gli1_ACAGTG_L003_R2_001.fastq.gz')
     self.assertEqual(fq.sample_name,'NH1_ChIP-seq_Gli1')
     self.assertEqual(fq.basename,'NH1_ChIP-seq_Gli1_ACAGTG_L003_R2_001')
     self.assertEqual(fq.extension,'.fastq.gz')
     self.assertEqual(fq.sample_number,None)
     self.assertEqual(fq.barcode_sequence,'ACAGTG')
     self.assertEqual(fq.lane_number,3)
     self.assertEqual(fq.read_number,2)
     self.assertEqual(fq.set_number,1)
     self.assertFalse(fq.is_index_read)
     self.assertEqual(str(fq),'NH1_ChIP-seq_Gli1_ACAGTG_L003_R2_001')
Esempio n. 7
0
 def test_non_standard_sample_name(self):
     """IlluminaFastqAttrs: non-standard Fastq names with sample name only
     """
     fq = IlluminaFastqAttrs('NH1_ChIP-seq.r2')
     self.assertEqual(fq.sample_name,'NH1_ChIP-seq')
     self.assertEqual(fq.basename,'NH1_ChIP-seq.r2')
     self.assertEqual(fq.extension,'')
     self.assertEqual(fq.sample_number,None)
     self.assertEqual(fq.barcode_sequence,None)
     self.assertEqual(fq.lane_number,None)
     self.assertEqual(fq.read_number,2)
     self.assertEqual(fq.set_number,None)
     self.assertFalse(fq.is_index_read)
     self.assertEqual(str(fq),'NH1_ChIP-seq.r2')
Esempio n. 8
0
 def test_name_tag_and_lane_paired_end(self):
     """IlluminaFastqAttrs: reduced fastq name (sample name, barcode and lane, paired end)
     """
     fq = IlluminaFastqAttrs('NH1_ChIP-seq_Gli1_ACAGTG_L001_R2')
     self.assertEqual(fq.sample_name,'NH1_ChIP-seq_Gli1')
     self.assertEqual(fq.basename,'NH1_ChIP-seq_Gli1_ACAGTG_L001_R2')
     self.assertEqual(fq.extension,'')
     self.assertEqual(fq.sample_number,None)
     self.assertEqual(fq.barcode_sequence,'ACAGTG')
     self.assertEqual(fq.lane_number,1)
     self.assertEqual(fq.read_number,2)
     self.assertEqual(fq.set_number,None)
     self.assertFalse(fq.is_index_read)
     self.assertEqual(str(fq),'NH1_ChIP-seq_Gli1_ACAGTG_L001_R2')
Esempio n. 9
0
 def test_name_only(self):
     """IlluminaFastqAttrs: reduced fastq name (sample name only)
     """
     fq = IlluminaFastqAttrs('NH1_ChIP-seq_Gli1')
     self.assertEqual(fq.sample_name,'NH1_ChIP-seq_Gli1')
     self.assertEqual(fq.basename,'NH1_ChIP-seq_Gli1')
     self.assertEqual(fq.extension,'')
     self.assertEqual(fq.sample_number,None)
     self.assertEqual(fq.barcode_sequence,None)
     self.assertEqual(fq.lane_number,None)
     self.assertEqual(fq.read_number,None)
     self.assertEqual(fq.set_number,None)
     self.assertFalse(fq.is_index_read)
     self.assertEqual(str(fq),'NH1_ChIP-seq_Gli1')
 def test_full_name(self):
     """IlluminaFastqAttrs: full Illumina-style fastq name
     """
     fq = IlluminaFastqAttrs('NH1_ChIP-seq_Gli1_ACAGTG_L003_R2_001')
     self.assertEqual(fq.sample_name, 'NH1_ChIP-seq_Gli1')
     self.assertEqual(fq.basename, 'NH1_ChIP-seq_Gli1_ACAGTG_L003_R2_001')
     self.assertEqual(fq.extension, '')
     self.assertEqual(fq.sample_number, None)
     self.assertEqual(fq.barcode_sequence, 'ACAGTG')
     self.assertEqual(fq.lane_number, 3)
     self.assertEqual(fq.read_number, 2)
     self.assertEqual(fq.set_number, 1)
     self.assertFalse(fq.is_index_read)
     self.assertEqual(str(fq), 'NH1_ChIP-seq_Gli1_ACAGTG_L003_R2_001')
 def test_name_no_lane_blc2fastq2(self):
     """IlluminaFastqAttrs: Illumina fastq name from bcl2fastq2 (without lane)
     """
     fq = IlluminaFastqAttrs('NH1_ChIP-seq_Gli1_S4_R2_001')
     self.assertEqual(fq.sample_name, 'NH1_ChIP-seq_Gli1')
     self.assertEqual(fq.basename, 'NH1_ChIP-seq_Gli1_S4_R2_001')
     self.assertEqual(fq.extension, '')
     self.assertEqual(fq.sample_number, 4)
     self.assertEqual(fq.barcode_sequence, None)
     self.assertEqual(fq.lane_number, None)
     self.assertEqual(fq.read_number, 2)
     self.assertEqual(fq.set_number, 1)
     self.assertFalse(fq.is_index_read)
     self.assertEqual(str(fq), 'NH1_ChIP-seq_Gli1_S4_R2_001')