首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导CSE 11程序、讲解Java编程、Java语言程序调试 讲解Database|辅导Python程序
项目预算:
开发周期:
发布时间:
要求地区:
CSE 11 Winter 2021 PA2 - COVID Genomic
Sequence
Due date: Tuesday, Jan 19 @ 11:59PM PST
(Wednesday, Jan 20 @ 11:59PM PST w/ slip day. If you submit your assignment late, the autograder will
automatically use your slip day if you have any remaining. Note that the README portion of this assignment
cannot be submitted late.)
Provided Files
None.
Files to Submit
CovidGenomeAnalysis.java
CovidMutation.java
Goal:
Programming Assignment 2 is an introduction to loops and Strings in Java. You will use loops, String methods,
and other programming techniques to complete the assignment.
Please read the entire write-up before getting started.
Some General Notes
Most of these notes are necessary for autograding purposes. If any of these does not make sense, you
probably aren't doing anything that it applies to. However, you should make sure that when you do learn
about it later on in this quarter that you follow these notes. We cannot be lenient regarding these things
because everything is autograded to ensure fairness.
Make sure to read the autograder output after you submit to Gradescope (wait until the autograder is
finished running).
Match the specifications that we provide exactly, otherwise we cannot ensure that the autograder will
function correctly. This includes file names, class names, method signatures, extending, throwing, etc.
"Constants" should be defined as private static final variables.
Do not use any static variables (other than for constants) or instance variables that are not specified in this
writeup. We cannot ensure that these do not get clobbered during grading. Any extra variables used should
be local only.
Unless otherwise specified, do not add any extra import s or use any packages not from java.lang other
than those implied or explicitly named by this writeup.
Do not specify a package for your files. This will cause them to fail to compile with the autograder.
Do not add any extra classes to your files and do not write code in files that are not specified.
Do not call helper methods except from the class where they are implemented, as we will be using our own
version of classes during grading (which will only have the instance variables and methods specified in this
writeup). You shouldn't be able to call them anyway if you have declared them as private .
If a behavior (say, on some specific input) is not specified, you may handle that case however you want.
However, if you implement a specific behavior for some special case of a required method, do not rely on
that specific behavior when using that method as a helper method (only assume that the method works as
specified in the writeup).
For the surveys and AI form, make sure you are filling them out and specifying your email address as the
one linked with your Gradescope account. If you fill them out after submitting, you can either resubmit to
update your score immediately or wait for us to rerun the autograder for everyone after the deadline.
Any late submission will trigger a slip day usage for this assignment. There will be no exceptions for
"accidents," since we cannot determine if it is an actual accident. If you need special accommodations,
please email the Professor directly.
Part 1: CovidGenomeAnalysis.java
You have just been recruited to join a lab working on the genetic sequence of COVID-19 because of the skills
you demonstrated in the first PA of CSE 11. You will now use your knowledge of computer science to help
scientists develop a more effective and cheaper vaccine for COVID-19.
COVID-19 is a RNA virus, meaning that its genetic sequence is made of adenine (A), cytosine (C), guanine (G),
and uracil (U). This is in contrast with DNA, which has thymine (T) instead of uracil. However, because of
instability of RNA, it must be converted into DNA to be sequenced (you can read more about this here). For this
reason, we will use the complementary DNA for this assignment. In other words, the genome we are using will
contain A, T, C, and G.
A DNA molecule consists of two strands wound around each other, with each strand held together by
bonds between the nitrogenous nucleobases. Adenine (A) pairs with thymine (T) and cytosine (C) pairs
with guanine (G).
Reference: https://www.genome.gov/genetics-glossary/acgt
Task
We want to first run some simple analyses. Given what we know about DNA, if we know the bases on one strand
of the DNA, we can know which bases are on the other strand of the DNA. We also want to count the number of
times a specific base appears on one strand. We will implement this in the main() method of the
CovidGenomeAnalysis class in the CovidGenomeAnalysis.java file.
public class CovidGenomeAnalysis {...}
public class CovidGenomeAnalysis {
...
public static void main(String[] args);
...
}
Input
Just like in PA1, we will read user input from System.in using a Scanner (remember to import it). After a user
runs java CovidGenomeAnalysis , they will then type the input to our program. For this assignment, you can
safely assume that this input will come as a single line of characters and that each character before the newline
character is a capital letter A, T, C, or G.
Output
After reading in the string given as input, we will print some output to System.out . This printout will always be
two items, separated by a single space, followed by a single newline character. The System.out.println() method
will print whatever String is passed in followed by a newline, so if you use it, you do not need to explicitly add a
newline character. If you use System.out.print() , you will need to add the newline character yourself. There is no
invalid input case (as we are assuming the input will always follow the format above), so the first item should be
the number of thymine (T) nucleotides that appear in the strand opposite the input sequence and the second item
should be the strand opposite the input sequence. The opposite strand's bases should be in the order determined
by the input strand and should only contain the capital characters A, T, C, and G.
Implementation
Valid Inputs
Your program should work for any input that does not have characters other than A, T, C, and G.
Testing
It would be easier to use input from a file rather than typing the input each time we want to test our code. We
haven't learned file IO yet, but we can still do it with the Scanner from System.in and pipe input to System.in
from a file.
There are many ways to do this, but the following way is pretty system agnostic. First, we will need to make
some file whose raw data has the genome sequence we want to use as input (as the first line). For this purpose,
we should use the .txt extension for the file name to avoid confusion. To have the .txt file be read from
System.in , we will use a combination of the cat command and | (pipe) symbol.
Cat is short for concatenate. If we were to just do cat file.txt , it would display the content of the file.txt to the
terminal. We instead then use | to redirect the output of a command to the input of another. In our case, we will
be redirecting the output of the cat command into the input of our Java program.
(For Windows users, cat is available in PowerShell. If you are using command prompt, the equivalent command
is type .)
Sample Test Case
Case 1
Input: ACGTAAGCA
Output: 4 TGCATTCGT (there are 4 letter T s in the output sequence)
You can run this case by having a file sample1.txt with the contents:
and running the command cat sample1.txt | java CovidGenomeAnalysis .
ACGTAAGCA
Part 2: CovidMutation.java
You are recruited to another research lab at UCSD because of your exceptional work in helping create a new
vaccine. This lab is on the forefront of a COVID-19 cure using an antibody treatment. This antibody treatment
works by mutilating the genome sequence of the COVID-19 virus such that the nucleotides formed by this
mutilated sequence turn the virus into a clump of molecules that is easily broken down by white blood cells. The
research lab has a genome sequence simulator that takes in a string of nucleobases (Adenine, Guanine, Thymine,
Cytosine, Uracil) and simulates the DNA/RNA chain of that potential organism and its characteristics. The lab
has found that they can control the antibodies to specifically reverse every k (some integer) nucleobases of the
virus. In order to produce this treatment with the greatest efficacy possible, the research lab must find some k that
has the highest rate of weakening the COVID-19 virus.
Task
Given some genome sequence, we want to find the output if we did this k-reversing. Since this technique might
be used in the future, we will allow it to work for any string and hope the researchers pass in a valid genome
sequence for now. Our application should be able to take any string and any integer k and reverse every k-sized
chunk of the string. We will implement this in the main() method of the CovidMutation class in the
CovidMutation.java file.
Input
We will read user input from System.in using a Scanner (remember to import it). After a user runs java
CovidMutation , they will then type the input to our program. For this assignment, you can safely assume that this
input will come as a single line of characters followed by an integer on the next line. The first line will be the
string to k-reverse (all you need to know is that it is a string of characters) and the integer k in the next line will
represent the "chunk size."
Output
After checking the inputs, we will print some output to System.out . This printout will always be a single string
followed by a single newline character. In the case of invalid inputs (see below), print out the original input string
(the string from the first line of input). In the case of valid inputs, print out the k-reversed version of the input
string. If the length of the string is not divisible by k then you should reverse all characters in the remainder of the
string after the last full chunk. If the given k is greater than the length of string, you should completely reverse
the entire string (this is a special case of the case described in the previous sentence). Note that this means that
the output should always have the same length as the input string.
public class CovidMutation {...}
public class CovidMutation {
...
public static void main(String[] args);
...
}
Implementation
Valid Inputs
The first line will be any string (i.e., possibly composed of characters other than A, C, T, and G). The integer in
the second line must be at least 1 to be valid.
Testing
You can use the same procedure as for Part 1. The only difference will be that the second line of your input file
will contain the integer representing the chunk size.
Sample Test Case
Case 1
Input: sequence = ACGTAAGCA ; k = 3
Output: GCAAATACG (the k chunk size given is 3 which means we will reverse every 3
nucleotides. This gives ACG|TAA|GCA, if we are to reverse each chunk we will have
GCA|AAT|ACG.)
Case 2
Input: sequence = ACGTAAGCA ; k = 7
Output: GAATGCAAC (the k chunk size given is 7 which means we will reverse every 7
nucleotides. This gives ACGTAAG|CA, if we are to reverse the first full chunk we will have
GAATGCA. If there is a remainder left that is smaller than the k given, it should be fully reversed. In
this case we have 2 nucleobases (CA) left and those should be reversed to result in GAATGCA|AC.)
Style
Coding style is an important part of ensuring readability and maintainability of your code. We will grade your
code style in all submitted code files according to the style guidelines. Namely, there are a few things you must
have in each file/class/method:
1. File headers
2. Class headers
3. Method headers
4. Inline comments
5. Proper indentation (do not intermingle spaces and tabs for indentation)
6. Descriptive variable names
7. No magic numbers
8. Reasonably short methods (if you have implemented each method according to specification in this writeup,
you’re fine)
9. Lines shorter than 80 characters (note, tabs will be counted as 4 characters toward this limit. It is a good
idea to set your tab width/size to be 4. A good way to check is using the command grep -n '.\{81,\}' *.java
in the directory with your files, but note that this won't necessarily take tabulation into account
appropriately.)
10. Javadoc conventions (@param, @return tags, /** header comments */, etc.)
A full style guide can be found here. In addition, an example of a properly styled Java file can be found here. If
you need any clarifications, feel free to ask on Piazza.
README
All the questions for the README portion of this assignment can be found on Gradescope. Note that this portion
of the assignment cannot be submitted late.
Survey
Please fill out this survey, worth 1 point to your PA grade, to help us improve the experience of this class! We ask
that you write thoughtful and truthful answers, to the best of your ability. Your specific answers will not affect
your grade in any way. You will receive credit as long as you complete it.
Weekly Reflection 2.
Submission:
Turning in your code
Submit all of the following files to Gradescope by Tuesday, Jan 19 @ 11:59PM PST (Wednesday, Jan 20 @
11:59PM PST w/ slip day):
CovidGenomeAnalysis.java
CovidMutation.java
When submitting, please wait until the autograder finishes running and read the output. Your code must compile
in the autograder in order to receive proper partial credit. Make sure that you have followed the General
Notes to ensure that the autograder can run.
Evaluation
1. Correctness (89 points)
You will earn points based on the autograder tests that your code passes. If the autograder tests are not able
to run (e.g., your code does not compile or it does not match the specifications in this writeup), you may
not earn credit.
2. Coding Style (5 points)
3. README (5 points)
4. Weekly Reflection Survey (1 point)
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写math 1151, autumn 2024 w...
2024-11-14
代做comp4336/9336 mobile dat...
2024-11-14
代做eesa01 lab 2: weather an...
2024-11-14
代写comp1521 - 24t3 assignme...
2024-11-14
代写nbs8020 - dissertation s...
2024-11-14
代做fin b377f technical anal...
2024-11-14
代做ceic6714 mini design pro...
2024-11-14
代做introduction to computer...
2024-11-14
代做cs 353, fall 2024 introd...
2024-11-14
代做phy254 problem set #3 fa...
2024-11-14
代写n1569 financial risk man...
2024-11-14
代写csci-ua.0202 lab 3: enco...
2024-11-14
代写econ2226: chinese econom...
2024-11-14
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!