GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — biofx_python/05_gc at main · Vstrains/biofx_python

Expand file tree

/

05_gc

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

05_gc

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
tests
tests
 
 
.gitignore
.gitignore
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
bench.sh
bench.sh
 
 
gc.orig
gc.orig
 
 
genseq.py
genseq.py
 
 
solution1_list.py
solution1_list.py
 
 
solution2_unit.py
solution2_unit.py
 
 
solution3_max_var.py
solution3_max_var.py
 
 
solution4_list_comp.py
solution4_list_comp.py
 
 
solution5_filter.py
solution5_filter.py
 
 
solution6_map.py
solution6_map.py
 
 
solution7_re.py
solution7_re.py
 
 
solution8_list_comp_map.py
solution8_list_comp_map.py
 
 

README.md

Outline

Finding GC Content in Sequences

http://rosalind.info/problems/gc/

Write a Python program called cgc.py that takes a single positional argument which should be a readable text file.

The program should print a "usage" statement for -h or --help flags:

$ ./cgc.py -h
usage: cgc.py [-h] FILE

Compute GC content

positional arguments:
  FILE        Input sequence file

optional arguments:
  -h, --help  show this help message and exit

The input file will be in FASTA format:

$ cat tests/inputs/1.fa
>Rosalind_6404
CCTGCGGAAGATCGGCACTAGAATAGCCAGAACCGTTTCTCTGAGGCTTCCGGCCTTCCC
TCCCACTAATAATTCTGAGG
>Rosalind_5959
CCATCGGTAGCGCATCCTTAGTCCAATTAAGTCCCTATCCAGGCGCTCCGCCGAAGGTCT
ATATCCATTTGTCAGCAGACACGC
>Rosalind_0808
CCACCCTCGTGGTATGGCTAGGCATTCAGGAACCGGAGAACGCTTCAGACCAGCCCGGAC
TGGGAACCTGCGGGCAGTAGGTGGAAT

The output should be the sequence ID with the highest GC content along with that GC content as a floating-point value to 6 significant digits:

$ ./cgc.py tests/inputs/1.fa
Rosalind_0808 60.919540

A fully passing test suite looks like the following:

$ make test
python3 -m pytest -xv --disable-pytest-warnings --flake8 --pylint 
--mypy cgc.py tests/cgc_test.py
============================ test session starts ============================
...

cgc.py::FLAKE8 SKIPPED                                                [  9%]
cgc.py::mypy PASSED                                                   [ 18%]
cgc.py::test_gc PASSED                                                [ 27%]
tests/cgc_test.py::FLAKE8 SKIPPED                                     [ 36%]
tests/cgc_test.py::mypy PASSED                                        [ 45%]
tests/cgc_test.py::test_exists PASSED                                 [ 54%]
tests/cgc_test.py::test_usage PASSED                                  [ 63%]
tests/cgc_test.py::test_bad_input PASSED                              [ 72%]
tests/cgc_test.py::test_good_input1 PASSED                            [ 81%]
tests/cgc_test.py::test_good_input2 PASSED                            [ 90%]
::mypy PASSED                                                         [100%]
=================================== mypy ====================================

Success: no issues found in 2 source files
======================= 9 passed, 2 skipped in 1.39s ========================

Author

Ken Youens-Clark [email protected]

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.