anastasiyaprymolenna / deduper Goto Github PK
View Code? Open in Web Editor NEWThis project forked from leslie-c/deduper
This project forked from leslie-c/deduper
Your pseudocode is well-organized and easy to follow. Specific elements I liked were the convert_phred() function (mostly because I hadn't thought to use it myself) and your obvious comprehension and conveyance of the bitwise components. I see that you have a global chromosome counter to increment each time you flush and move on to the next chromosome. Don't forget to set it to 1, assuming that your pre-Python Samtools sort lists the chromosomes from 1. I'm not entirely sure why you used "out.write file" at the end of your code when you specified that you'll be writing out to the file before you flush. Maybe you meant "file.close()"? Overall, this was really well done. Great job!
I was a little confused by the flow of the pseudocode because you didn’t specify when you would call convert_phred and when/how you would extract the umi and CIGAR string. I’m also not sure why it was necessary to store the whole sequence in the alignment dictionary. It didn’t seem like you specified the average quality score in the dictionary, which seems necessary. At the part where the script checks if the umi, leftmost position, and strand is in the dictionary and finds that it is not, you just say continue. It seems like you meant to append to the dictionary here. I like how you chose to make a list to store the observed UMIs and check it before comparing to the dictionary to make the code more efficient. Overall the pseudocode makes sense and does everything that it is supposed to.
Both convert_phred and check_bitflag are widely applicable and standalone functions. If youre just taking an average in the convert_phred function, it would probably be more efficient to just increment a score variable then divide by the length of the sequence, instead of keeping track of an index and appending a list.
First, “elif the strandedness, UMI, and Adjusted left most position combo in dictionary compare the quality score to the stored dictionary sequence” seems like it needs to be inside of the first if statement.
What I mean is that:
if key(tuple) exists:
check quality score then choose which one to store
else
continue
Second, in your dictionary, you might want to store the quality score in order to compare to the reads that have the same keys.
It seems to do everything including some bonus(checking the quality scores).
I don’t really understand what you’re trying to average for the convert_phred function. Are you taking the average of the current read or averaging by base pair position? Also maybe you want to add a function about checking the CIGAR string for adjusting soft clipping.
Great job overall!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.