Skip to content

Commit

Permalink
feat(san): Created function to remove disallowed characters from samp…
Browse files Browse the repository at this point in the history
…le names.
  • Loading branch information
nbtm-sh committed Oct 23, 2024
1 parent 08b876e commit 9b60e19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion create_samplesheet.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3
import argparse, os, tempfile, json, re, logging, sys
VERSION="0.2"
VERSION="0.3"

# Consts
MODE_STRING_CSV = 0
Expand All @@ -18,6 +18,11 @@ def __init__(self, name, path, data):
self.path = path
self.data = data

def sanitize_input(input_str, disallowed_chars = [',', ' ', '<', '>', '.', "'", '"', ';', ':'], replcement='_'):
for i in disallowed_chars:
input_str = input_str.replace(i, '_')
return input_str

def sample_name(aa_seq, seq_chars=6):
trunc_aa_seq = aa_seq[:min(seq_chars, len(aa_seq))]
return trunc_aa_seq
Expand Down

0 comments on commit 9b60e19

Please sign in to comment.