Skip to main content

MilanG's Python package for APBC A0-A4

Project description

#Collection of assignments for APBC2021 as a single package

Usage: $ MilanG-Git_A5 [options] [filename]

Options: -h, --help show this help message and exit -A0 Use the Hello World module. -A1 Use the Word Count module. -I WordCount option: count words in case ignore mode. -l WordCount option: print a list of counted words, instead of pure counts. -A2 Use the Administration module to optimise costs. -o Administration option: Optimises the cost and prints the best solution. -A3 Use the Manhattan module to find the best path through a weighted matrix. -d Manhattan option: Include diagonal_matrix paths. -t Manhattan option: Print the path from start to finish -A4 {dice,mono,klet} Use the Random sequence module to shuffle sequences. Three methods are available: 1. rolling dice, 2. mono shuffle, 3. k-let shuffle. -N N Random sequence option: Number of random sequences printed. Default=1 --verbose Random sequence option: Print verbose output -k K Random sequence, k-let shuffle option: Length of k-lets. Default=2

Modules: -A0 HelloWorld: Will take a text file and print "Hello World!" and the contents of the file in the next line to screen.

-A1 WordCount: Counts the words in a text file and prints " / " to screen. The count can be case insensitive with -I. And the sorted list of words can be printed with -l.

-A2 Administration: Needs a file containing the number of capitals and the maximum cost in the first line, aswell as a matrix containing the cost of pairs. With -o flag only the best combination will be printe with the corresponding score. Example input:

  8 10                     # number of capitals; cost limit
   B  E  G  I  K  L  P  S  # names of capitals
   - 10 10  2 10 10 10 10  # symmetric cost matrix
  10  -  2 10 10 10  1 10
  10  2  - 10  2  3  3  3
   2 10 10  -  4 10 10  2
  10 10  2  4  - 10 10  3
  10 10  3 10 10  -  2  2
  10  1  3 10 10  2  - 10
  10 10  3  2  3  2 10  -

-A3 Manhattan: Calculates the best (highest pointed) path through a matrix. -d will include diagonal weights in the calculation -t will calculate the path through the grid. Example input:

#G_down: 4 5
  0.60   0.65   0.91   0.94   0.14
  0.85   0.27   0.70   0.31   0.63
  0.63   0.23   0.35   0.77   0.20
  0.37   0.76   0.41   0.30   0.67
#---
#G_right: 5 4
  0.76   0.41   0.72   0.13
  0.57   0.64   0.62   0.62
  0.37   0.98   0.36   0.24
  0.99   0.77   0.39   0.35
  0.37   0.34   0.62   0.82
#---
#G_diag: 4 4
  6.74   7.03   2.47   6.25
  4.48   3.75   2.98   3.62
  7.90   3.63   3.67   3.18
  9.30   8.40   9.02   2.58
#---

-A4 Random Sequences: Will take sequences and return -N N random sequencs. Three methods are available: -Rolling dice: Calculates the frequencies of letters (nucleotides) in a sequence and randomly generates new sequences with the same frequencies as the input sequenc. -Mono shuffle: Iterates through the sequence and swaps each letter with a randomly chosen one later in the sequence. -K-let shuffle: Shuffles k-lets of a given length (-k K) to generate random sequences, preserving the k-let composition.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MilanG-git_A5-1.0.10.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

MilanG_git_A5-1.0.10-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file MilanG-git_A5-1.0.10.tar.gz.

File metadata

  • Download URL: MilanG-git_A5-1.0.10.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8

File hashes

Hashes for MilanG-git_A5-1.0.10.tar.gz
Algorithm Hash digest
SHA256 9cba913af833872ba033dd05dfcf213d32b3905b79373034e38cdd80fd247da7
MD5 b90b532f572de1b1476e53531cf904de
BLAKE2b-256 a2f125491a4f732859d6b0647661f8e9e3a156e9ad5edf06446f26c18cf4fed1

See more details on using hashes here.

File details

Details for the file MilanG_git_A5-1.0.10-py3-none-any.whl.

File metadata

  • Download URL: MilanG_git_A5-1.0.10-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8

File hashes

Hashes for MilanG_git_A5-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 dd641c9f7504be3c2f8b1c0faca3a900453bda1282fe5257f4cda1ba8b681f50
MD5 dc4e116f6bc5eb4b177550062524c1af
BLAKE2b-256 8f00d5d11fc189cb00cdda9503794d30b7320b52eb14b9562a6b67b8307bda82

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page