File: AlignOrientedReads.py

package info (click to toggle)
shasta 0.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,636 kB
  • sloc: cpp: 82,262; python: 2,348; makefile: 222; sh: 143
file content (43 lines) | stat: -rwxr-xr-x 1,106 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
#!/usr/bin/python3

import shasta
import GetConfig
import sys

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

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

# Get the arguments.
if not len(sys.argv) == 5:
    print(helpMessage)
    exit(1)
readId0 = int(sys.argv[1]);
strand0 = int(sys.argv[2]);
readId1 = int(sys.argv[3]);
strand1 = int(sys.argv[4]);

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

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

# For convenience, write the markers sorted by position.
a.writeMarkers(readId=readId0, strand=strand0, 
    fileName = 'Markers-ByPosition-0.csv')
a.writeMarkers(readId=readId1, strand=strand1, 
    fileName = 'Markers-ByPosition-1.csv')

# Compute the alignment.
a.alignOrientedReads(
    readId0 = readId0, strand0 = strand0,
    readId1 = readId1, strand1 = strand1,
    maxSkip = int(config['Align']['maxSkip']),
    maxDrift = int(config['Align']['maxDrift']),
    maxMarkerFrequency = int(config['Align']['maxMarkerFrequency']))