User Tools

Site Tools


assignment4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
assignment4 [2018/10/10 16:29]
dokuroot
assignment4 [2018/10/10 21:46]
dokuroot
Line 4: Line 4:
  
 **Due date:​** ​ 10/16/18 at 10 am **Due date:​** ​ 10/16/18 at 10 am
 +\\
 +\\
 +Follow the [[ script:​template | template]] shown in class for writing your code.  The "​main"​ segment of the module should prompt the user for the arguments and pass them to the functions.
  
 ====Exercise 1==== ====Exercise 1====
  
-Write a function, fastq_fasta(),​ that converts a fastq file to a new fasta formatted file.+Write a function, ​''​fastq_fasta(input_file, output_file)''​, that converts a fastq file to a new fasta formatted file.
 \\ \\
  
 The function should have the following attributes: The function should have the following attributes:
-  * Prompts the user for the input and output file names. 
   * Trims off the '​@'​ sign at the beginning of each ID line.   * Trims off the '​@'​ sign at the beginning of each ID line.
   * Exits gracefully if it can't open the the files.   * Exits gracefully if it can't open the the files.
Line 42: Line 44:
 ====Exercise 2==== ====Exercise 2====
  
-Write a function, fastq_trimmer(),​ that trims any number of nucleotides from the 5' end of each read and any number of nucleotides from the 3' end of each read in a fastq file and writes the results to a new fastq formatted file.+Write a function, ​''​fastq_trimmer(input_file, output_file,​ trim_5p, trim_3p)''​, that trims any number of nucleotides from the 5' end of each read and any number of nucleotides from the 3' end of each read in a fastq file and writes the results to a new fastq formatted file.
  
 The function should have the following attributes: The function should have the following attributes:
-  * Prompts the user for the input file name,  the output file name, the number of nucleotides to trim from the 5' end, and the number of nucleotides to trim from the 3' end. 
   * Exits gracefully if it can't open the the files.   * Exits gracefully if it can't open the the files.
-  * Prints to the terminal the number of reads that were processed and the original and resulting read length with the assumption that all reads are the same length.+  * Prints to the terminal the number of reads that were processed and the original and resulting read length with the assumption that all reads are the same length. ​For example:
  
   Reads processed: 12345678 ​   Reads processed: 12345678 ​
assignment4.txt ยท Last modified: 2018/10/10 22:02 by dokuroot