#!/usr/bin/env python3 import os.path from os import path import pysam import sys # command line arguments inputMarkersFlankingGenes = sys.argv[1] # table with mapped flanking ISBPs from genes outputDir = sys.argv[2] # output directory ... genomeQuery = sys.argv[3] # fasta file of the v1 genome (must be fai indexed) genomeTarget = sys.argv[4] # fasta file of the v2 genome (must bie fai indexed) def main(): ### check for input files and output directory checkFile(file=inputMarkersFlankingGenes) if ( not checkDir(directory=outputDir) ): sys.stdout.write( " Creating output directory %s" % str(outputDir)) os.mkdir( outputDir, 0o750 ) #open for reading the reference file ### read input file containing the flanking IBSP markers for each gene def checkFile (file): if os.path.isfile(file): sys.stdout.write(" File %s found\n" % str(file)) else: sys.stderr.write(" ERROR: Cannot find file %s \n" % str(file)) sys.exit() def checkDir(directory): if os.path.isdir(directory): sys.stdout.write(" Directory %s found\n" % str(directory)) else: sys.stderr.write(" ERROR: Cannot find directory %s \n" % str(directory)) if __name__== "__main__": main()