Commits

Anton Goloborodko  committed 4f92e4a

mapping.py: add better error messages to iterative_mapping()

  • Participants
  • Parent commits aefe17c

Comments (0)

Files changed (1)

File src/hiclib/mapping.py

 
     '''
     bowtie_path = os.path.abspath(os.path.expanduser(bowtie_path))
+    if not os.path.isfile(bowtie_path):
+        raise Exception(
+            'The bowtie binary is not found '
+            'at the specified path: {0}.'.format(bowtie_path))
     bowtie_index_path = os.path.abspath(os.path.expanduser(bowtie_index_path))
     fastq_path = os.path.abspath(os.path.expanduser(fastq_path))
+    if not os.path.isfile(fastq_path):
+        raise Exception(
+            'The fastq file is not found '
+            'at the specified path: {0}.'.format(fastq_path))
     out_sam_path = os.path.abspath(os.path.expanduser(out_sam_path))
 
     seq_start = kwargs.get('seq_start', 0)
             bash_reader = 'gunzip -c'
         else:
             bash_reader = 'cat'
+    else:
+        bash_reader = os.path.abspath(os.path.expanduser(bash_reader))
+        if not os.path.isfile(bash_reader.split()[0]):
+            raise Exception(
+                'The bash reader is not found '
+                'at the specified location {0}.'.format(bash_reader))
 
     reading_command = bash_reader.split() + [fastq_path, ]