GithubHelp home page GithubHelp logo

deduper's Introduction

Deduper

Part 1

Use this repo template to create your own Deduper repo - you should do all your work in your own repository. Please name it Deduper-<github-user-name>.

Write up a strategy for writing a Reference Based PCR Duplicate Removal tool. That is, given a sorted sam file of uniquely mapped reads, remove all PCR duplicates (retain only a single copy of each read). Develop a strategy that avoids loading everything into memory. You should not write any code for this portion of the assignment. Be sure to:

  • Define the problem
  • Write examples:
    • Include a properly formated sorted input sam file
    • Include a properly formated expected output sam file
  • Develop your algorithm using pseudocode
  • Determine high level functions
    • Description
    • Function headers
    • Test examples (for individual functions)
    • Return statement

For this portion of the assignment, you should design your algorithm for single-end data, with 96 UMIs. UMI information will be in the QNAME, like so: NS500451:154:HWKTMBGXX:1:11101:15364:1139:GAACAGGT. Discard any UMIs with errors (or think about how you might error correct, if you're feeling ambitious).

Part 2

An important part of writing code is reviewing code - both your own and other's. In this portion of the assignment, you will be assigned 3 students' pseudocode algorithms to review. Be sure to evaluate the following points:

  • Does the proposed algorithm make sense to you? Can you follow the logic?
  • Does the algorithm do everything it's supposed to do? (see part 1)
  • Are proposed functions reasonable? Are they "standalone" pieces of code?

You can find your assigned reviewees on Canvas. You can find your fellow students' repositories at

github.com/<user>/Deduper-<github-user-name>

Be sure to leave comments on their repositories by creating issues or by commenting on the pull request.

Part 3

Write your deduper function!

Given a SAM file of uniquely mapped reads, and a text file containing the known UMIs, remove all PCR duplicates (retain only a single copy of each read). Remember:

  • Your Python code can assume a sorted sam file (you might need to use samtools sort outside of your Python script)
  • Account for:
    • all possible CIGAR strings (including adjusting for soft clipping, etc.)
    • Strand
    • Single-end reads
    • Known UMIs
  • Considerations:
    • Millions of reads โ€“ avoid loading everything into memory!
    • Be sure to utilize functions appropriately
    • Appropriately comment code and include doc strings
  • CHALLENGE: In a separate branch, implement options for
    • Single-end vs paired-end
    • Known UMIs vs randomers
    • Error correction of known UMIs
    • Choice of duplicate written to file

You MUST:

  • Write Python 3.11 compatible code
  • Include the following argparse options
    • -f, --file: designates absolute file path to sorted sam file
    • -o, --outfile: designates absolute file path to sorted sam file
    • -u, --umi: designates file containing the list of UMIs
    • -h, --help: prints a USEFUL help message (see argparse docs)
      • That is, your code must be able to run (in a single step) if given a command in the format:
        ./<your_last_name>_deduper.py -u STL96.txt -f <in.sam> -o <out.sam>
        
  • Output the first read encountered if duplicates are found
  • Output a properly formatted SAM file
  • Name your python script <your_last_name>_deduper.py and place it in the top level of your repo (that is, not inside a folder)

deduper's People

Contributors

leslie-c avatar

Stargazers

Wyatt Eng avatar Zach Goode avatar

Watchers

 avatar

deduper's Issues

pseudocode feedback -MB

-Problem is well stated and concise. As the reader I can tell exactly what problem you are addressing. It might be helpful to include a quick statement of how your code will address the problem before you jump into it.

-General workflow gives a good overview of how your code will flow.

-For sort_SAM I'm pretty sure you can use a bash command that will sort your file

-Your get_UMI function is maybe a little too simplified to an outside reader. After reading through this and the main function I'm uncertain of it's prominent role and when you plan to call it. I would consider maybe explaining more, but I think in your actual code this will be a good function.

-get read info is well stated and defined. Good use of input and output.

-for the main_function, do you think keeping this a function or writing this as general code to help with memory storage will be better? I do think your structure and checks through the pseudocode are very logical and very easy to follow. It's easy to see how you are going to pass in your files, parse them, apply your duplicate checks, and then output to a "good or bad file". I feel like when you actually are writing your code you'll have a good structure to go off of. I think it would be helpful to add another little section after your functions to walk through how you plan to place and apply them.

I think you're on the right track though and your code is logically written and mostly easy to follow. If you have any questions or concerns with my statements feel free to reach out to me!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.