Skip to content

Commit

Permalink
Trim viralrecon Medaka VCF ".merged" to get sample name
Browse files Browse the repository at this point in the history
  • Loading branch information
peterk87 committed Mar 18, 2022
1 parent c65afa6 commit 44f4a37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion xlavir/io/xl.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,24 @@ def write_xlsx_report(dfs: List[ExcelSheetDataFrame],
include_header=esdf.include_header_width),
idx_and_cols)):
if col_name in float_cols:
logger.debug(f'{esdf.sheet_name}|Column {col_name} ({i}) width = {width}')
sheet.set_column(i, i, width, monospace_float_fmt)
elif col_name in perc_cols:
logger.debug(f'{esdf.sheet_name}|Column {col_name} ({i}) width = {width}')
sheet.set_column(i, i, width, monospace_perc_fmt)
elif col_name in perc_2dec_cols:
logger.debug(f'{esdf.sheet_name}|Column {col_name} ({i}) width = {width}')
sheet.set_column(i, i, width, monospace_perc_2dec_fmt)
else:
logger.debug(f'{esdf.sheet_name}|Column {col_name} ({i}) width = {width}')
sheet.set_column(i, i, width, monospace_fmt)
if not esdf.include_header_width:
for i, col_name in enumerate(idx_and_cols):
sheet.write_string(0, i, string=col_name, cell_format=header_with_wrap_fmt)

elif esdf.column_widths:
for i, (width, col_name) in enumerate(zip(esdf.column_widths, idx_and_cols)):
logger.debug(f'{esdf.sheet_name}|Column {col_name} ({i}) width = {width}')
sheet.set_column(i, i, width, monospace_wrap_fmt)

for i, idx in enumerate(esdf.df.index, 1):
Expand Down Expand Up @@ -237,7 +242,7 @@ def write_xlsx_report(dfs: List[ExcelSheetDataFrame],
max_type='max')}
)

if images_for_sheets and not images_added:
if images_for_sheets is not None and not images_added:
add_images(images_for_sheets, book)

df_qc = get_qc_df(dfs)
Expand Down
3 changes: 2 additions & 1 deletion xlavir/tools/pangolin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

logger = logging.getLogger(__name__)

PANGOLIN_CSV = 'pangolin.lineage_report.csv'
PANGOLIN_CSV = 'pangolin.csv'

PANGOLIN_GLOB_PATTERNS = [
'**/*.pangolin.csv',
'**/pangolin.csv',
]

PANGOLIN_SAMPLE_NAME_CLEANUP = [
Expand Down
1 change: 1 addition & 0 deletions xlavir/tools/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ class VariantCaller(Enum):
re.compile(r'\.longshot'),
re.compile(r'\.snpeff'),
re.compile(r'\.no_fs'),
re.compile(r'\.merged'),
]

SNPSIFT_GLOB_PATTERNS = [
Expand Down

0 comments on commit 44f4a37

Please sign in to comment.