Hi!
I extracted mapped and unmapped reads of different BAM files using a bash script.
Now, I want to compare which reads are in which BAM files in python.
I imagined to use python sets (union, intersection) to do that.
Unfortunately, I have only little python experience.
I already could write a script that does the job, but without using loops etc for automation.
I tried this:
import glob
path = "/path/to/files/*.txt"
list_of_files=glob.glob(path)
Now, I want to read in all lines of the files using readlines(), and store the output in separate variables to create sets using the .update() function.
Do you have an idea how to do that?
Greetings
I extracted mapped and unmapped reads of different BAM files using a bash script.
Now, I want to compare which reads are in which BAM files in python.
I imagined to use python sets (union, intersection) to do that.
Unfortunately, I have only little python experience.
I already could write a script that does the job, but without using loops etc for automation.
I tried this:
import glob
path = "/path/to/files/*.txt"
list_of_files=glob.glob(path)
Now, I want to read in all lines of the files using readlines(), and store the output in separate variables to create sets using the .update() function.
Do you have an idea how to do that?
Greetings
Comment