Giter VIP home page Giter VIP logo

fastx-barber's People

Contributors

dependabot[bot] avatar ggirelli avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fastx-barber's Issues

[BUG] Output is not gzipped if input is uncompressed

Describe the bug
Running e.g., time fbarber extract input.test.fastq test.trimmed.fastq.gz will write uncompressed output to test.trimmed.fastq.gz, as the input (input.test.fastq) is not gzipped. The output should be correctly compressed instead or the .gz extension should be dropped.

[REQUEST] Non regexp-based pattern for speed-up in certain use cases

To speed up in cases in which no perfect match is needed and the flag length is fixed, use a pattern format constituting of single-char flag names and flag lengths, e.g., "U8B8C4", indicating a "U" flag of 8, a "B" flag of 8, and a "C" flag of 4 chars, respectively, with the pattern placed at the start of the sequence.

[REQUEST] Add flagstat option to extract script

Is your feature request related to a problem? Please describe.
Generate summary of extracted flag values (frequency). Also make separate script that runs on fastx files with extracted flag values.

(PYL-W0102) Dangerous default argument

Description

Do not use a mutable like list or dictionary as a default value to an argument. Python’s default arguments are evaluated once when the function is defined. Using a mutable default argument and mutating it will mutate that object for all future calls to the function as well.

Occurrences

There is 1 occurrence of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/ggirelli/fastx-barber/issue/PYL-W0102/occurrences/

(PYL-W0211) Bad `staticmethod` argument detected

Description

It is customary for instance or class methods to take self or cls, respectively, as their first arguments, a method that uses either of these names but is found to be a static method may have been defined incorrectly. Choose names other than self or cls for arguments to avoid …

Occurrences

There is 1 occurrence of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/ggirelli/fastx-barber/issue/PYL-W0211/occurrences/

[REQUEST] Allow for different AND/OR pattern combinations in flag regex

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[REQUEST] Option to build suggested "whitelist" or barcode patterns

Evaluate flag value to identify the most represented one(s) and suggest value(s) and mismatch filter.

Basically, use the flag (barcode) value frequency and the expected N number of flag values, to select the top N barcodes and suggest also a number of allowed mismatches.

Should we require also a minimum edit distance between the original sequences or expected minimum distance?

is this project open to Hacktoberfest submissions?

I have a bunch of Bioinformatics students looking to get involved, I remember in the past people were trying stuff here but with the new rules of projects having to opt in I am not sure if fastx-barber was flagged for people to help out

[BUG] Logging crashes script when no reads match the pattern

Traceback (most recent call last):
  File "/home/gire/.local/bin/fbarber", line 8, in <module>
    sys.exit(main())
  File "/home/gire/.local/pipx/venvs/fastx-barber/lib/python3.7/site-packages/fastx_barber/scripts/barber.py", line 45, in main
    args.run(args)
  File "/home/gire/.local/pipx/venvs/fastx-barber/lib/python3.7/site-packages/fastx_barber/scripts/extract.py", line 336, in run
    f"({(n_matched-n_filtered)/n_matched*100:.2f}%)",
ZeroDivisionError: division by zero

[BUG] find_seq crash with --case-insensitive option

➜  gpseq-tutorial fbarber find_seq reference/Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz AAGCTT 
--case-insensitive --global-name --output reference/Homo_sapiens.GRCh38.dna.primary_assembly.HindIII_sites.bed.gz
--log-file reference/Homo_sapiens.GRCh38.dna.primary_assembly.HindIII_sites.log
[06/15/21 10:51:22] INFO     Log to          reference/Homo_sapiens.GRCh38.dna.primary_assembly.HindIII_sites.log                                                                                    scriptio.py:50
                    INFO     General                                                                                                                                                                find_seq.py:111
                    INFO     Input           reference/Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz                                                                                               find_seq.py:112
                    INFO     Needle          AAGCTT                                                                                                                                                 find_seq.py:113
                    INFO     Output          reference/Homo_sapiens.GRCh38.dna.primary_assembly.HindIII_sites.bed.gz                                                                                find_seq.py:114
                    INFO     Prefix          loc_                                                                                                                                                   find_seq.py:115
                    INFO     Global          True                                                                                                                                                   find_seq.py:116
Traceback (most recent call last):
  File "/home/gire/.local/bin/fbarber", line 8, in <module>
    sys.exit(main())
  File "/home/gire/.local/pipx/venvs/fastx-barber/lib/python3.8/site-packages/fastx_barber/scripts/barber.py", line 45, in main
    args.run(args)
  File "/home/gire/.local/pipx/venvs/fastx-barber/lib/python3.8/site-packages/fastx_barber/exception.py", line 14, in wrapper
    return fun(*args, **kwargs)
  File "/home/gire/.local/pipx/venvs/fastx-barber/lib/python3.8/site-packages/fastx_barber/scripts/find_seq.py", line 126, in run
    for pos, location_id in search_needle(record, args.needle, location_id):
  File "/home/gire/.local/pipx/venvs/fastx-barber/lib/python3.8/site-packages/fastx_barber/match.py", line 221, in search_needle
    header, seq, _ = record
ValueError: not enough values to unpack (expected 3, got 2)
➜  gpseq-tutorial 

[REQUEST] Fix flake8 warnings

Address the following:

./fastx_barber/scripts/extract.py:133:1: C901 'run_chunk' is too complex (7)
./fastx_barber/scripts/common.py:177:14: F541 f-string is missing placeholders
./fastx_barber/scripts/common.py:187:14: F541 f-string is missing placeholders

[REQUEST] Add unit tests

Writing unit tests after the code is a pain, but I guess this is what lazy asses deserve... 😢

[BUG] find_seq crash

➜  reference fbarber find_seq Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz AAGCTT 
--case-insensitive --global-name --output Homo_sapiens.GRCh38.dna.primary_assembly.HindIII_sites.bed.gz
--log-file Homo_sapiens.GRCh38.dna.primary_assembly.HindIII_sites.log
[06/15/21 10:17:50] INFO     Log to                                                        scriptio.py:50
                             Homo_sapiens.GRCh38.dna.primary_assembly.HindIII_sites.log                  
                    INFO     General                                                      find_seq.py:111
                    INFO     Input                                                        find_seq.py:112
                             Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz                              
                    INFO     Needle          AAGCTT                                       find_seq.py:113
                    INFO     Output          Homo_sapiens.GRCh38.dna.primary_assembly.Hin find_seq.py:114
                             dIII_sites.bed.gz                                                           
                    INFO     Prefix          loc_                                         find_seq.py:115
                    INFO     Global          True                                         find_seq.py:116
Traceback (most recent call last):
  File "/home/gire/.local/bin/fbarber", line 8, in <module>
    sys.exit(main())
  File "/home/gire/.local/lib/python3.8/site-packages/fastx_barber/scripts/barber.py", line 45, in main
    args.run(args)
  File "/home/gire/.local/lib/python3.8/site-packages/fastx_barber/exception.py", line 14, in wrapper
    return fun(*args, **kwargs)
  File "/home/gire/.local/lib/python3.8/site-packages/fastx_barber/scripts/find_seq.py", line 125, in run
    record[1] = record[1].upper()
TypeError: 'tuple' object does not support item assignment

[REQUEST] Change quality flags extraction method

The current approach of saving quality flag string portions by appending a "q" prefix to the flag name is prone to flag name conflicts. Instead, the qual string could be saved as a third flag value by moving from key/value to key/value[/qual] format and updating the FlagReader class accordingly.

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.