Git Product home page Git Product logo

andrl_utils's Introduction

Sequence File Parser

This Python script parses sequence files in a specified input directory and writes the parsed content to a specified output directory. The script can optionally overwrite existing files in the output directory.

Usage

You can run the script from the command line as follows:

python unaliner.py input_folder_path output_folder_path

Replace input_folder_path and output_folder_path with the paths to your actual input and output folders.

If you want to run the script without overwriting existing files, you can use the --not_overwrite flag:

python unaliner.py input_folder_path output_folder_path --not_overwrite

This will run the script and skip files that already exist in the output folder.

Functions

The script contains the following functions:

  • process_lines(non_empty_lines: List[str]) -> List[str] Processes a list of non-empty lines from a file. If a line starts with ">", it's a name and you can skip it. Every line after that, until the next line with ">", is a sequence and you need to remove all trailing newlines.

  • parse_and_write(input_folder: str, output_folder: str, overwrite: bool) -> None: Parses files in the input_folder and writes the parsed content to the output_folder. If overwrite is False, the script will skip files that already exist in the output folder.

  • main() -> None: Parses command line arguments and processes the files. If --not_overwrite is True, the script will ask for user confirmation before overwriting existing files.

andrl_utils's People

Contributors

brbis35 avatar jendahorak avatar

Watchers

 avatar

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.