Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sniffle convert handling #300

Merged
merged 17 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/mavis/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def __init__(self, start: int, end: Optional[int] = None, freq: int = 1, number_

self.start = self.number_type(self.start)
self.end = self.number_type(self.end)
if self.start == 0 and self.end == 1:
self.start = 1
if self.start > self.end:
raise AttributeError('interval start > end is not allowed', self.start, self.end)
self.freq = int(freq)
Expand Down
4 changes: 4 additions & 0 deletions src/mavis/tools/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class SUPPORTED_TOOL(MavisNamespace):
'dup': [SVTYPE.DUP],
'ITD': [SVTYPE.DUP],
'IDP': [SVTYPE.INS],
'DEL/INV': [SVTYPE.DEL, SVTYPE.INV],
'DUP/INS': [SVTYPE.DUP, SVTYPE.INS],
'INVDUP': [SVTYPE.INV, SVTYPE.DUP, SVTYPE.INS],
'INV/INVDUP': [SVTYPE.INV, SVTYPE.DUP, SVTYPE.INS],
}
)

Expand Down
4 changes: 2 additions & 2 deletions src/mavis/tools/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def pandas_vcf(input_file) -> Tuple[List[str], pd.DataFrame]:
# read the data
df = pd.read_csv(
input_file,
sep='\t',
sep="\t",
skiprows=len(header_lines),
dtype={
'CHROM': str,
Expand All @@ -286,7 +286,7 @@ def pandas_vcf(input_file) -> Tuple[List[str], pd.DataFrame]:
'REF': str,
'ALT': str,
},
na_values=PANDAS_DEFAULT_NA_VALUES + ['.'],
na_values=PANDAS_DEFAULT_NA_VALUES + ["."],
)
df = df.rename(columns={df.columns[0]: df.columns[0].replace('#', '')})
required_columns = ['CHROM', 'INFO', 'POS', 'REF', 'ALT', 'ID']
Expand Down
Loading