Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with sorting sam files in python! mavadhani General 6 12-08-2016 11:14 AM
Python API for VCF files mspivakov Bioinformatics 7 04-08-2014 04:51 AM
What linux spreadsheet program can you open .sam files in? KnowNothing2 Bioinformatics 11 12-11-2013 03:13 AM
Blastn cannot open .nin files PlutonicFriend Bioinformatics 1 07-24-2012 01:37 PM
open *.sh files. dror Bioinformatics 1 11-14-2010 04:45 AM

Thread Tools
Old 03-14-2019, 06:35 AM   #1
Location: HD

Join Date: Mar 2019
Posts: 12
Default Open and read files in python


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"

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?

deKoch13 is offline   Reply With Quote
Old 03-25-2019, 09:20 AM   #2
Junior Member
Location: Brazil

Join Date: Sep 2017
Posts: 5

Why you are using Python?
You can look for Biopython module. There is a function to import your seq and alignment.

The same can be made (with more options) in linux terminal w/ STAR algorithm.
luminasapientiae is offline   Reply With Quote

file handling, python

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 09:29 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO