<s> """<STR_LIT>""" <EOL> import os <EOL> print "<STR_LIT>" , os . getcwd ( ) <EOL> from integrationtest import IntegrationTest , main <EOL> from testdata import TEST_DATA_DIRECTORY <EOL> import unittest <EOL> import subprocess <EOL> import os <EOL> class TestBamReadcount ( IntegrationTest , unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> IntegrationTest . setUp ( self ) <EOL> self . data_dir = TEST_DATA_DIRECTORY <EOL> self . orig_path = os . path . realpath ( os . getcwd ( ) ) <EOL> self . exe_path = os . path . realpath ( self . exe_path ) <EOL> os . chdir ( self . data_dir ) <EOL> def tearDown ( self ) : <EOL> IntegrationTest . tearDown ( self ) <EOL> os . chdir ( self . orig_path ) <EOL> def test_bamreadcount_normal ( self ) : <EOL> """<STR_LIT>""" <EOL> expected_file = "<STR_LIT>" <EOL> bam_file = "<STR_LIT>" <EOL> ref_fasta = "<STR_LIT>" <EOL> site_list = "<STR_LIT>" <EOL> output_file = self . tempFile ( "<STR_LIT>" ) <EOL> cmdline = "<STR_LIT:U+0020>" . join ( [ self . exe_path , '<STR_LIT>' , ref_fasta , '<STR_LIT>' , site_list , bam_file , '<STR_LIT:>>' , output_file ] ) <EOL> print "<STR_LIT>" , cmdline <EOL> print "<STR_LIT>" , os . getcwd ( ) <EOL> rv = subprocess . call ( cmdline , shell = True ) <EOL> print "<STR_LIT>" , rv <EOL> self . assertEqual ( <NUM_LIT:0> , rv ) <EOL> self . assertFilesEqual ( expected_file , output_file ) <EOL> def test_bamreadcount_perlib ( self ) : <EOL> """<STR_LIT>""" <EOL> expected_file = "<STR_LIT>" <EOL> bam_file = "<STR_LIT>" <EOL> ref_fasta = "<STR_LIT>" <EOL> site_list = "<STR_LIT>" <EOL> output_file = self . tempFile ( "<STR_LIT>" ) <EOL> cmdline = "<STR_LIT:U+0020>" . join ( [ self . exe_path , '<STR_LIT>' , '<STR_LIT>' , ref_fasta , '<STR_LIT>' , site_list , bam_file , '<STR_LIT:>>' , output_file ] ) <EOL> print "<STR_LIT>" , cmdline <EOL> print "<STR_LIT>" , os . getcwd ( ) <EOL> rv = subprocess . call ( cmdline , shell = True ) <EOL> print "<STR_LIT>" , rv <EOL> self . assertEqual ( <NUM_LIT:0> , rv ) <EOL> self . assertFilesEqual ( expected_file , output_file ) <EOL> def test_bamreadcount_normal_as_list ( self ) : <EOL> """<STR_LIT>""" <EOL> expected_file = "<STR_LIT>" <EOL> bam_file = "<STR_LIT>" <EOL> ref_fasta = "<STR_LIT>" <EOL> regions = "<STR_LIT>" <EOL> output_file = self . tempFile ( "<STR_LIT>" ) <EOL> cmdline = "<STR_LIT:U+0020>" . join ( [ self . exe_path , '<STR_LIT>' , ref_fasta , bam_file , regions , '<STR_LIT:>>' , output_file ] ) <EOL> print "<STR_LIT>" , cmdline <EOL> print "<STR_LIT>" , os . getcwd ( ) <EOL> rv = subprocess . call ( cmdline , shell = True ) <EOL> print "<STR_LIT>" , rv <EOL> self . assertEqual ( <NUM_LIT:0> , rv ) <EOL> self . assertFilesEqual ( expected_file , output_file ) <EOL> def test_bamreadcount_when_lib_absent ( self ) : <EOL> """<STR_LIT>""" <EOL> expected_file = "<STR_LIT>" <EOL> bam_file = "<STR_LIT>" <EOL> ref_fasta = "<STR_LIT>" <EOL> regions = "<STR_LIT>" <EOL> output_file = self . tempFile ( "<STR_LIT>" ) <EOL> cmdline = "<STR_LIT:U+0020>" . join ( [ self . exe_path , '<STR_LIT>' , ref_fasta , bam_file , regions , '<STR_LIT:>>' , output_file ] ) <EOL> print "<STR_LIT>" , cmdline <EOL> print "<STR_LIT>" , os . getcwd ( ) <EOL> rv = subprocess . call ( cmdline , shell = True ) <EOL> print "<STR_LIT>" , rv <EOL> self . assertEqual ( <NUM_LIT:0> , rv ) <EOL> self . assertFilesEqual ( expected_file , output_file ) <EOL> def test_bamreadcount_indel_centric_normal ( self ) : <EOL> """<STR_LIT>""" <EOL> expected_file = "<STR_LIT>" <EOL> bam_file = "<STR_LIT>" <EOL> ref_fasta = "<STR_LIT>" <EOL> site_list = "<STR_LIT>" <EOL> output_file = self . tempFile ( "<STR_LIT>" ) <EOL> cmdline = "<STR_LIT:U+0020>" . join ( [ self . exe_path , '<STR_LIT>' , '<STR_LIT>' , ref_fasta , '<STR_LIT>' , site_list , bam_file , '<STR_LIT:>>' , output_file ] ) <EOL> print "<STR_LIT>" , cmdline <EOL> print "<STR_LIT>" , os . getcwd ( ) <EOL> rv = subprocess . call ( cmdline , shell = True ) <EOL> print "<STR_LIT>" , rv <EOL> self . assertEqual ( <NUM_LIT:0> , rv ) <EOL> self . assertFilesEqual ( expected_file , output_file ) <EOL> def test_bamreadcount_indel_centric_per_lib ( self ) : <EOL> """<STR_LIT>""" <EOL> expected_file = "<STR_LIT>" <EOL> bam_file = "<STR_LIT>" <EOL> ref_fasta = "<STR_LIT>" <EOL> site_list = "<STR_LIT>" <EOL> output_file = self . tempFile ( "<STR_LIT>" ) <EOL> cmdline = "<STR_LIT:U+0020>" . join ( [ self . exe_path , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , ref_fasta , '<STR_LIT>' , site_list , bam_file , '<STR_LIT:>>' , output_file ] ) <EOL> print "<STR_LIT>" , cmdline <EOL> print "<STR_LIT>" , os . getcwd ( ) <EOL> rv = subprocess . call ( cmdline , shell = True ) <EOL> print "<STR_LIT>" , rv <EOL> self . assertEqual ( <NUM_LIT:0> , rv ) <EOL> self . assertFilesEqual ( expected_file , output_file ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
