Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastaheader reading, Memory reduction and speedup #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Imoteph
Copy link

@Imoteph Imoteph commented Jun 3, 2015

Changed some part of the code for the first Step. Reduced the memory footprint in our case from 300GB to 2GB. Additionally it will create a speedup as no unnecessary copies are produced.

Imoteph added 3 commits June 3, 2015 11:35
Add new extractMummer function to reduce memory foodprint and speed up! As it does the necessary steps during reading the line!
Calls the new function in alignerRobot
Takes only the first header information of the for each fasta header as mummer does.
@@ -18,7 +18,8 @@ def obtainLength(folderName, fileName):
if tmplen != 0:
lenDic[tmpName] = tmplen
tmplen = 0
tmpName = tmp[1:]
headerList = tmp.split();
tmpName = headerList[0][1:]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this:

tmpName = tmp.split(None, 1)[1:]

There is often more than one space in the FASTA header lines, so splitting at the first space may well be quicker overall.

Also there is no reason to create the extra temp variable headerList here, is there?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) thats indeed looks better, at that time it was just a quick and dirty fix.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a shame the tool owner has not been active here recently...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants