Compare commits
No commits in common. "7ed975c7ce5688901a60667f34e42d4b60dde738" and "e826d6f92b53a3e9f57f1327d54c6ea9cadcb310" have entirely different histories.
7ed975c7ce
...
e826d6f92b
11
parser.py
11
parser.py
|
@ -6,9 +6,9 @@ from re import sub
|
|||
from pandas import DataFrame, read_html, Series
|
||||
|
||||
|
||||
def remove_parenthesis(identifier):
|
||||
sequence_str = "".join(map(str, identifier))
|
||||
return sub(r"[()]", "", sequence_str)
|
||||
def find_html_files(path) -> List:
|
||||
file_list = glob(path + "/*fastqc.html")
|
||||
return file_list
|
||||
|
||||
|
||||
def extract_adapters(files) -> Tuple[Series, List]:
|
||||
|
@ -36,7 +36,8 @@ def preprocess_dataframe(adapters) -> Series:
|
|||
def save_to_file(filename, adapters) -> None:
|
||||
with open(filename, "w") as f:
|
||||
for index, value in adapters.iteritems():
|
||||
sequence_id = remove_parenthesis(index)
|
||||
sequence_str = "".join(map(str, index))
|
||||
sequence_id = sub(r"[()]", "", sequence_str)
|
||||
fasta_entry = f">{sequence_id}\n{value}\n"
|
||||
f.write(fasta_entry)
|
||||
|
||||
|
@ -50,7 +51,7 @@ def parse_arguments():
|
|||
|
||||
def main():
|
||||
args = parse_arguments()
|
||||
file_list = glob(args.input + "/*fastqc.html")
|
||||
file_list = find_html_files(args.input)
|
||||
adapters, stats = extract_adapters(file_list)
|
||||
save_to_file(args.output, adapters)
|
||||
print(
|
||||
|
|
Loading…
Reference in New Issue