def test_reading_frame1(self): seed = 'AAGCGGGGCATGCGAGTACA' # Amino seq: ?AGHAST (shifted one base) coord = 'HAS' expected_extract = 'CATGCGAGT' # Amino seq: HAS extract = extract_target(seed, coord) self.assertEqual(expected_extract, extract)
def test_extract(self): seed = 'GCGGGGCATGCGAGTACA' # Amino seq: AGHAST coord = 'HAS' expected_extract = 'CATGCGAGT' # Amino seq: HAS extract = extract_target(seed, coord) self.assertEqual(expected_extract, extract)
def extract_v3loop_ref(): ref_filename = os.path.join(os.path.dirname(__file__), 'v3loop_ref.txt') try: with open(ref_filename) as f: v3loop_ref = f.read() except FileNotFoundError: project_config = ProjectConfig.loadDefault() hiv_seed = project_config.getReference(G2P_SEED_NAME) coordinate_ref = project_config.getReference(COORDINATE_REF_NAME) v3loop_ref = extract_target(hiv_seed, coordinate_ref) with open(ref_filename, 'w') as f: f.write(v3loop_ref) return v3loop_ref