예제 #1
0
 def test_count_variants_with_indel(self):
     '''
     A method to test the get_total_variants function with indels.
     '''
     var_file = 'data/sampleA.variants.tsv'
     fasta_file = 'data/tester.fa'
     self.assertEqual(get_total_variants(file=var_file, reference=fasta_file,
                                         indel=True)['total_variants'],
                      10,
                      '10 variants')
예제 #2
0
 def test_count_variants_no_indel(self):
     '''
     A method to test the get_total_variants function without indels.
     '''
     var_file = 'data/sampleA.variants.tsv'
     fasta_file = 'data/tester.fa'
     total_variants = get_total_variants(file=var_file, reference=fasta_file,
                                         indel=False)
     self.assertEqual(total_variants['total_variants'], 9,
                      '9 single nucleotide variant')
예제 #3
0
                    help='full path to the reference FASTA file')
parser.add_argument('--mask_start',
                    default=100,
                    help='number of bases to mask at start of genome')
parser.add_argument('--mask_end',
                    default=50,
                    help='number of bases to mask at end of genome')
if len(sys.argv) == 1:
    parser.print_help(sys.stderr)
    sys.exit(1)
args = parser.parse_args()
qc_line = {}
qc_line.update(
    qc.get_total_variants(file=args.variants,
                          reference=args.reference,
                          indel=args.indel,
                          mask_start=int(args.mask_start),
                          mask_end=int(args.mask_end)))
qc_line.update(qc.get_qc_data(file=args.qc))
qc_line.update(qc.get_coverage_stats(file=args.coverage))
qc_line.update(qc.count_iupac_in_fasta(fasta=args.fasta))
try:
    meta_data = qc.import_metadata(file=args.meta)
    qc_line['ct'] = meta_data[qc_line['sample_name']]['ct']
    qc_line['date'] = meta_data[qc_line['sample_name']]['date']
except:
    qc_line['ct'] = 'NA'
    qc_line['date'] = 'NA'

qc.write_qc_summary_header()
qc.write_qc_summary(summary=qc_line)
예제 #4
0
 def test_count_variants_with_indel(self):
     self.assertEqual(get_total_variants(file='data/sampleA.variants.tsv',indel=True)['total_variants'], 10, '10 variants')
예제 #5
0
 def test_count_variants_no_indel(self):
     total_variants = get_total_variants(file='data/sampleA.variants.tsv', indel=False)
     self.assertEqual(total_variants['total_variants'], 9, '9 single nucleotide variant')
     self.assertEqual(total_variants['total_n'], 2, '2 single nucleotide variant')
     self.assertEqual(total_variants['total_iupac'], 4, '4 single nucleotide variant')