File: AlignOrientedReads4.py

package info (click to toggle)
shasta 0.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 29,648 kB
  • sloc: cpp: 82,262; python: 2,348; makefile: 223; sh: 143
file content (56 lines) | stat: -rwxr-xr-x 1,898 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/python3

import shasta
import GetConfig
import sys

helpMessage = """
This computes a marker alignment of two oriented reads 
using alignment method 4.

Invoke with four arguments: readId0, strand0, readId1, strand1.
"""

# Get the arguments.
import argparse
parser = argparse.ArgumentParser(
    description='This computes a marker alignment of two oriented reads using alignment method 4.')
parser.add_argument('readId0', type=int)
parser.add_argument('strand0', type=int, choices=range(2))
parser.add_argument('readId1', type=int)
parser.add_argument('strand1', type=int, choices=range(2))
arguments = parser.parse_args()

# Read the config file.
config = GetConfig.getConfig()

# Initialize the assembler and access what we need.
a = shasta.Assembler()
a.accessMarkers()

# This can fail if sorted markers are not avaialble, in which 
# case alignOrientedReads4 computes sorted markers on the fly.
a.accessSortedMarkers()

# Compute the alignment.
a.alignOrientedReads4(
    readId0 = arguments.readId0, strand0 = arguments.strand0,
    readId1 = arguments.readId1, strand1 = arguments.strand1,
    deltaX = int(config['Align']['align4.deltaX']),
    deltaY = int(config['Align']['align4.deltaY']),
    minEntryCountPerCell = int(config['Align']['align4.minEntryCountPerCell']),
    maxDistanceFromBoundary = int(config['Align']['align4.maxDistanceFromBoundary']),
    minAlignedMarkerCount = int(config['Align']['minAlignedMarkerCount']),
    minAlignedFraction = float(config['Align']['minAlignedFraction']),
    maxSkip = int(config['Align']['maxSkip']),
    maxDrift = int(config['Align']['maxDrift']),
    maxTrim = int(config['Align']['maxTrim']),
    maxBand = int(config['Align']['maxBand']),
    matchScore = int(config['Align']['matchScore']),
    mismatchScore = int(config['Align']['mismatchScore']),
    gapScore = int(config['Align']['gapScore']))