Working with Dictionaries and Lists/Sets
Modules you can use:
argparse, reLinks, osLinks, collectionsLinks, sysLinks
General Guidelines (Steps 1-6)
You have more flexibility to implement your own function names and logic in these programs.
The data files you need for this assignment can obtained from:
HUGO_genes.txt, chr21_genes.txt
Create an output directory inside your assignment4 directory called "OUTPUT" for result files, so
that they will not mix with your programs. Output from your programs will be here!
Pay close attention to how you'll run the run_lints.sh script (see below)
Your program must implement command line options for the infiles it must open, but for
testing purposes it should run by default, so if no command line option is passed at the command
line, the program will still run. This will help in the grading of your program.
Create a Python Module called called io_utils.py. Put this io_utils.py Module in a subdirectory
named assignment4 inside your assignment4 top-level directory (see the tree below). Anytime a
file needs to be opened (read or write) in your programs in this assignment, the program should
call on this module's function get_filehandle. You can then use io_utils.get_filehandle by doing
this at the top of your programs:
from assignment4 import io_utils
# I can then use the module's get_filehandle() function by:
fh_in = io_utils.get_filehandle(infile1, "r") # note the function call "io_utils.get_filehandle()"
You can also import this way (Either way is acceptable, but I will assume in this assignment you
did it the way below. I think this is better for Pycharm)
from assignment4.io_utils import get_filehandle
# I can then use the module's get_filehandle() function by:
fh_in = get_filehandle(infile1, "r") # note the function call "get_filehandle()"
Your final submission must have the following files in bold and must use this directory structure.
Make sure you put a blank __init__.py where I've denoted below, e.g.: assignment4/
assignment4 (see below)
Make sure you have __init__.py only in assignment4/assignment4 folder, the tests folder, the unit
folder, and not in the assignment4 main folder.
Information on Source files
The chr21_genes.txt file lists genes from human chromosome 21, in their order along the
chromosome, as described in Hattori et al. (Nature 405, 311-319)Links to an external site.. For
each gene, the file gives the gene symbol, description and category. The fields are separated by
tabs. You will need to get the the meaning of each category. You can find these meanings in the
original paperLinks to an external site., under the "Gene categories" section. Create a file named
chr21_genes_categories.txt that store this information in tab separated fields:
This will be used in program #2
The HUGO_genes.txt file lists all human genes having official symbol approved by the HUGO
gene nomenclature committeeLinks to an external site. (some have probably changed by now).
For each gene, the file gives its symbo.
Reaction StatisticsBackgroundWhen collecting experimental data f.pdffashionbigchennai
Reaction Statistics
Background
When collecting experimental data from chemical reactions, it’s often useful to generate
statistics based on the data. One experimental measure is the reaction rate in moles per second,
representing the amount of product formed per unit time. If we have a set of these reaction rates
collected in a data file, we can calculate summary statistical information, such as the minimum
and maximum values, the arithmetic mean, variance, and standard deviation.
Finding the minimum and maximum are straightforward: we scan through all the data, and keep
track of the smallest and largest values encountered. The arithmetic mean (or average) is defined
as:
m = (X1+X2+…+Xn)/n
where n is the number of reaction rates, and xi represents one experimental reaction rate. Once
you have the arithmetic mean, the variance can be calculated as the mean of the squares of the
deviations from the mean:
v= ((Xn-m)^2+(X2 – m^2) + …+(Xn-m)^2)/n
where n is the number of reaction rates, xi represents one experimental reaction rate, and m is the
arithmetic mean of the reaction rates. Once you have the variance, you can calculate the
standarddeviation as:
s = sqrt(v)
Assignment
You will develop a C program that reads data from an input text file containing chemical
reaction rates (in moles per second), and computes the minimum, maximum, arithmetic mean,
variance, and standard deviation for that set of data. Your instructor will provide input text files,
which will each contain a series of double values, each on a line of its own within the file. Your
program will read one of these input files into an array of doubles (i.e., it will populate the array
using the data values from the file). Your program will then calculate statistics using that array of
doubles, and will write the results out to a separate output text file.
The goals of this assignment are to provide you with experience reading and writing text data
files, provide you with experience passing an array into a function, and give you more
experience organizing your program into separate C functions.
When defining your C functions, you may either:
Define the functions before they are used by any other functions, OR
Place function prototypes near the top of your code (after all #include directives), and then define
the functions in any order.
Part 1 – Opening Files and Reading Data
Create a new Visual Studio Win32 Console project named reactionstats. Create a new C source
file named project4.c within that project. At the top of the source file, #define
_CRT_SECURE_NO_WARNINGS, and then include stdio.h, math.h, stdlib.h, stdbool.h, and
float.h.
Inside your main function, define the following:
A one-dimensional array of 600 doubles. They do not need to be initialized to anything at this
stage.
An integer variable to hold the number of elements in the array, initialized using the approach
demonstrated in class, using sizeof.
A FILE pointer variable, which will refer to the input data text file..
CS 2336 PROJECT 3 – Linked Inventory Management Project Due: 11/04 by 11:59 PM KEY ITEMS: Key items are marked in red. Failure to include or complete key items will incur additional deductions as noted beside the item. Submission: • The file containing main must be named Main.java. (-5 points) • The project files must be in packages that start with LinkedInventoryManagement.* (-5 points) • All project deliverables are to be submitted in eLearning until further notice o Zip the contents of the src directory into a single zipped file o Make sure the zipped file has a .zip extension (not .tar, .rar, .7z, etc.) (-5 points) o Add your project’s presentation link in the comments section in eLearning • Programs must compile and run with Java SE 13. • Each student is responsible for developing unit test cases to ensure their program works as expected. • Type your name and netID in the comments at the top of all files submitted. (-5 points) Objectives: • Create a modular code solution with multi-packages • Use the Singleton pattern to create and manage the Scanner object • Create and manipulate a multi-directional LinkedList in Java • Use Java Generics to create generic classes and methods • Implement and use the Comparable interface Problem: A small electronics company has hired you to write an application to manage their inventory. The company requested a role-based access control (RBAC) to increase the security around using the new application. The company also requested that the application menu must be flexible enough to allow adding new menu items to the menu with minimal changes. This includes re-ordering the menu items and making changes to the description of a menu item without having to change the code. Security: The company has suggested to start the application by asking the user for a username and password to ensure that the user is authorized to access the application. There are two types of users at this company, managers and employees. If managers log on to the application, they will see all options on the menu list. If employees log on to the application, they will see a limited set of options on the menu list. User information is stored in Users.dat file, which may or may not exist at the start of the program. A super user “admin” with password “admin” has already been hardcoded in the program to allow for the initial setup and the creation of other users. The Users.dat file contains the FirstName, LastName, Username (case insensitive), HashedPassword and a flag to indicate whether a user is a manager or not. The file is comma separated and it is formatted as follows: Joe, Last, jlast, 58c536ed8facc2c2a293a18a48e3e120, true Sam,, sone, 2c2a293a18a48e3e12058c536ed8facc, false Jane, Best, jbest, 293a18a48e3e12052058c536ed8facc2c, false Application Menu: The menu of the application is dynamically loaded and displayed to the user only after the user successfully logs on. The menu items will be loaded from file “MenuList.dat”, which may o.
Write a program that asks the user for the name of a file. The progr.pdfarri2009av
Write a class named testscores. The class constructor should accept an array of rest scores as its
argument., The class should have a member function that returns the average of the test scores. If
any test score in the array is negative or greater than 100, the class should throw an exception.
Demonstrate the class in a program.
Solution
#include
#include
using namespace std;
class TestScores{
private:
float total = 0; //intiialising total marks
int length; //declaring variable for the size of scores array
bool invalid = false;
public:
TestScores(vector scores){
length = scores.size(); //length of vector of scores
for(int i = 0; i100){
cout<<\"Error! Invalid test score!\"; //error for invalid input
total = 0;
invalid = true;
}
else{
total+=scores[i];
}
}
}
float average(){
if(invalid==true){
return 0;
}
return this->total/this->length;
}
};
int main(){
vector scores;
scores.push_back(20);
scores.push_back(25);
scores.push_back(30);
scores.push_back(35);
scores.push_back(40);
scores.push_back(455);
scores.push_back(50);
TestScores testScores = TestScores(scores);
cout<<\"Average: \"<.
Program 1 – CS 344This assignment asks you to write a bash.docxwkyra78
Program 1 – CS 344
This assignment asks you to write a bash shell script to compute statistics. The purpose
is to get you familiar with the Unix shell, shell programming, Unix utilities, standard
input, output, and error, pipelines, process ids, exit values, and signals.
What you’re going to submit is your script, called stats.
Overview
NOTE: For this assignment, make sure that you are using Bash as your shell (on Linux,
/bin/sh is Bash, but on other Unix O/S, it is not). This is because the Solaris version of
Bourne shell has some annoying bugs that are really brought out by this script. Bash can
execute any /bin/sh script.
In this assignment you will write a Bourne shell script to calculate averages and medians
from an input file of numbers. This is the sort of calculation I might do when figuring
out the grades for this course. The input file will have whole number values separated by
tabs, and each line of this file will have the same number of values. (For example, each
row might be the scores of a student on assignments.) Your script should be able to
calculate the average and median across the rows (like I might do to calculate an
individual student's course grade) or down the columns (like I might do to find the
average score on an assignment).
You will probably need commands like these, so please read up on them: sh, read, expr,
cut, head, tail, wc, and sort.
Your script will be called stats. The general format of the stats command is
stats {-rows|-cols} [input_file]
Note that when things are in curly braces separated by a vertical bar, it means you should
choose one of the things; here for example, you must choose either -rows or -cols. The
option -rows calculates the average and median across the rows; the option -cols
calculates the average and median down the columns. When things are in square braces
it means they are optional; you can include them or not, as you choose. If you specify an
input_file the data is read from that file; otherwise, it is read from standard input.
Here is a sample run of what your script might return, using an input file called test_file
(this particular one can be downloaded here , note that in Windows, the newline
characters may not display as newlines. Move this to your UNIX account, without
opening and saving it in Windows, and then cat it out: you'll see the newlines there):
% cat test_file
1 1 1 1 1
9 3 4 5 5
6 7 8 9 7
3 6 8 9 1
3 4 2 1 4
6 4 4 7 7
% stats -rows test_file
Average Median
1 1
5 5
7 7
5 6
3 3
6 6
% cat test_file | stats –c
Averages:
5 4 5 5 4
Medians:
6 4 4 7 5
% echo $?
0
% stats
Usage: stats {-rows|-cols} [file]
% stats -r test_file nya-nya-nya
Usage: stats {-rows|-cols} [file]
% stats -both test_file
Usage: stats {-rows|-cols} [file]
% chmod -r test_file
% stats -columns test_file
stats: cannot read test_file
% stats -columns no_such_file
stats: cannot read no_such_file
% echo $?
1
Specifications
You must ch ...
Hello guys please make sure program runs well USING C anyth.pdfactioncbe1
Hello guys! please make sure program runs well
USING C anything else
If you are not sure about it please dont send it out
Through this programming assignment, the students will learn to do the following: 1. Practice
processing command line arguments. 2. Perform basic file I/O. 3. Use structs, pointers, and
strings. 4. Use dynamic memory. This assignment asks you to create a doubly linked list which will
be used to sort the words in an input file and print the sorted words to an output file (or standard
output) which will be the solution. Your program, called doublesort, will take the following
command line arguments: % doublesort [d] [-o output_file_name] input_file_name Read the words
in from the input file one at a time. Convert all the letters to lower case. Skip any punctuation or
special characters. If the output_file_name is given with the -o option, the program will output the
sorted letters to the given output file; otherwise, the output shall be to standard output. In addition
to parsing and processing the command line arguments, your program needs to do the following:
1. You need to construct a doubly linked list as you read from input. Each node in the list will link
to the one in front of it and the one behind it if they exist. They will have NULL for the previous
pointer if they are first in the list. They will have NULL for the next pointer if they are last in the list.
You can look up doubly linked lists in your Data Structure textbook. 2. Initially the list is empty. The
program reads from the input file one word at a time and converts it to lower case. Create a node
with a pointer to the word and 2 pointers to nodes, previous and next. Initially the previous and
next pointers should be NULL. 3. As long as you continue reading words, if the word is not already
in the list, create a new node and place the node into the list in the proper alphabetical order. If
there is a node in front of it, adjust the next pointer of that node to point to the new node and make
the previous pointer of the new node to point to the node in front of it. If there is a node after it then
adjust those pointers as well so the list remains continuous. All duplicate words are ignored. 4. An
end of file would indicate the end of input from the input file. 5. Once the program has read all the
input, the program then performs a traversal of the doubly linked list first to last, or last to first if the
- d option is set, to print one word at a time to the output file or stdout. Print one word per3. As
long as you continue reading words, if the word is not already in the list, create a new node and
place the node into the list in the proper alphabetical order. If there is a node in front of it, adjust
the next pointer of that node to point to the new node and make the previous pointer of the new
node to point to the node in front of it. If there is a node after it then adjust those pointers as well
so the list remains continuous. All duplicate words are igno.
Reaction StatisticsBackgroundWhen collecting experimental data f.pdffashionbigchennai
Reaction Statistics
Background
When collecting experimental data from chemical reactions, it’s often useful to generate
statistics based on the data. One experimental measure is the reaction rate in moles per second,
representing the amount of product formed per unit time. If we have a set of these reaction rates
collected in a data file, we can calculate summary statistical information, such as the minimum
and maximum values, the arithmetic mean, variance, and standard deviation.
Finding the minimum and maximum are straightforward: we scan through all the data, and keep
track of the smallest and largest values encountered. The arithmetic mean (or average) is defined
as:
m = (X1+X2+…+Xn)/n
where n is the number of reaction rates, and xi represents one experimental reaction rate. Once
you have the arithmetic mean, the variance can be calculated as the mean of the squares of the
deviations from the mean:
v= ((Xn-m)^2+(X2 – m^2) + …+(Xn-m)^2)/n
where n is the number of reaction rates, xi represents one experimental reaction rate, and m is the
arithmetic mean of the reaction rates. Once you have the variance, you can calculate the
standarddeviation as:
s = sqrt(v)
Assignment
You will develop a C program that reads data from an input text file containing chemical
reaction rates (in moles per second), and computes the minimum, maximum, arithmetic mean,
variance, and standard deviation for that set of data. Your instructor will provide input text files,
which will each contain a series of double values, each on a line of its own within the file. Your
program will read one of these input files into an array of doubles (i.e., it will populate the array
using the data values from the file). Your program will then calculate statistics using that array of
doubles, and will write the results out to a separate output text file.
The goals of this assignment are to provide you with experience reading and writing text data
files, provide you with experience passing an array into a function, and give you more
experience organizing your program into separate C functions.
When defining your C functions, you may either:
Define the functions before they are used by any other functions, OR
Place function prototypes near the top of your code (after all #include directives), and then define
the functions in any order.
Part 1 – Opening Files and Reading Data
Create a new Visual Studio Win32 Console project named reactionstats. Create a new C source
file named project4.c within that project. At the top of the source file, #define
_CRT_SECURE_NO_WARNINGS, and then include stdio.h, math.h, stdlib.h, stdbool.h, and
float.h.
Inside your main function, define the following:
A one-dimensional array of 600 doubles. They do not need to be initialized to anything at this
stage.
An integer variable to hold the number of elements in the array, initialized using the approach
demonstrated in class, using sizeof.
A FILE pointer variable, which will refer to the input data text file..
CS 2336 PROJECT 3 – Linked Inventory Management Project Due: 11/04 by 11:59 PM KEY ITEMS: Key items are marked in red. Failure to include or complete key items will incur additional deductions as noted beside the item. Submission: • The file containing main must be named Main.java. (-5 points) • The project files must be in packages that start with LinkedInventoryManagement.* (-5 points) • All project deliverables are to be submitted in eLearning until further notice o Zip the contents of the src directory into a single zipped file o Make sure the zipped file has a .zip extension (not .tar, .rar, .7z, etc.) (-5 points) o Add your project’s presentation link in the comments section in eLearning • Programs must compile and run with Java SE 13. • Each student is responsible for developing unit test cases to ensure their program works as expected. • Type your name and netID in the comments at the top of all files submitted. (-5 points) Objectives: • Create a modular code solution with multi-packages • Use the Singleton pattern to create and manage the Scanner object • Create and manipulate a multi-directional LinkedList in Java • Use Java Generics to create generic classes and methods • Implement and use the Comparable interface Problem: A small electronics company has hired you to write an application to manage their inventory. The company requested a role-based access control (RBAC) to increase the security around using the new application. The company also requested that the application menu must be flexible enough to allow adding new menu items to the menu with minimal changes. This includes re-ordering the menu items and making changes to the description of a menu item without having to change the code. Security: The company has suggested to start the application by asking the user for a username and password to ensure that the user is authorized to access the application. There are two types of users at this company, managers and employees. If managers log on to the application, they will see all options on the menu list. If employees log on to the application, they will see a limited set of options on the menu list. User information is stored in Users.dat file, which may or may not exist at the start of the program. A super user “admin” with password “admin” has already been hardcoded in the program to allow for the initial setup and the creation of other users. The Users.dat file contains the FirstName, LastName, Username (case insensitive), HashedPassword and a flag to indicate whether a user is a manager or not. The file is comma separated and it is formatted as follows: Joe, Last, jlast, 58c536ed8facc2c2a293a18a48e3e120, true Sam,, sone, 2c2a293a18a48e3e12058c536ed8facc, false Jane, Best, jbest, 293a18a48e3e12052058c536ed8facc2c, false Application Menu: The menu of the application is dynamically loaded and displayed to the user only after the user successfully logs on. The menu items will be loaded from file “MenuList.dat”, which may o.
Write a program that asks the user for the name of a file. The progr.pdfarri2009av
Write a class named testscores. The class constructor should accept an array of rest scores as its
argument., The class should have a member function that returns the average of the test scores. If
any test score in the array is negative or greater than 100, the class should throw an exception.
Demonstrate the class in a program.
Solution
#include
#include
using namespace std;
class TestScores{
private:
float total = 0; //intiialising total marks
int length; //declaring variable for the size of scores array
bool invalid = false;
public:
TestScores(vector scores){
length = scores.size(); //length of vector of scores
for(int i = 0; i100){
cout<<\"Error! Invalid test score!\"; //error for invalid input
total = 0;
invalid = true;
}
else{
total+=scores[i];
}
}
}
float average(){
if(invalid==true){
return 0;
}
return this->total/this->length;
}
};
int main(){
vector scores;
scores.push_back(20);
scores.push_back(25);
scores.push_back(30);
scores.push_back(35);
scores.push_back(40);
scores.push_back(455);
scores.push_back(50);
TestScores testScores = TestScores(scores);
cout<<\"Average: \"<.
Program 1 – CS 344This assignment asks you to write a bash.docxwkyra78
Program 1 – CS 344
This assignment asks you to write a bash shell script to compute statistics. The purpose
is to get you familiar with the Unix shell, shell programming, Unix utilities, standard
input, output, and error, pipelines, process ids, exit values, and signals.
What you’re going to submit is your script, called stats.
Overview
NOTE: For this assignment, make sure that you are using Bash as your shell (on Linux,
/bin/sh is Bash, but on other Unix O/S, it is not). This is because the Solaris version of
Bourne shell has some annoying bugs that are really brought out by this script. Bash can
execute any /bin/sh script.
In this assignment you will write a Bourne shell script to calculate averages and medians
from an input file of numbers. This is the sort of calculation I might do when figuring
out the grades for this course. The input file will have whole number values separated by
tabs, and each line of this file will have the same number of values. (For example, each
row might be the scores of a student on assignments.) Your script should be able to
calculate the average and median across the rows (like I might do to calculate an
individual student's course grade) or down the columns (like I might do to find the
average score on an assignment).
You will probably need commands like these, so please read up on them: sh, read, expr,
cut, head, tail, wc, and sort.
Your script will be called stats. The general format of the stats command is
stats {-rows|-cols} [input_file]
Note that when things are in curly braces separated by a vertical bar, it means you should
choose one of the things; here for example, you must choose either -rows or -cols. The
option -rows calculates the average and median across the rows; the option -cols
calculates the average and median down the columns. When things are in square braces
it means they are optional; you can include them or not, as you choose. If you specify an
input_file the data is read from that file; otherwise, it is read from standard input.
Here is a sample run of what your script might return, using an input file called test_file
(this particular one can be downloaded here , note that in Windows, the newline
characters may not display as newlines. Move this to your UNIX account, without
opening and saving it in Windows, and then cat it out: you'll see the newlines there):
% cat test_file
1 1 1 1 1
9 3 4 5 5
6 7 8 9 7
3 6 8 9 1
3 4 2 1 4
6 4 4 7 7
% stats -rows test_file
Average Median
1 1
5 5
7 7
5 6
3 3
6 6
% cat test_file | stats –c
Averages:
5 4 5 5 4
Medians:
6 4 4 7 5
% echo $?
0
% stats
Usage: stats {-rows|-cols} [file]
% stats -r test_file nya-nya-nya
Usage: stats {-rows|-cols} [file]
% stats -both test_file
Usage: stats {-rows|-cols} [file]
% chmod -r test_file
% stats -columns test_file
stats: cannot read test_file
% stats -columns no_such_file
stats: cannot read no_such_file
% echo $?
1
Specifications
You must ch ...
Hello guys please make sure program runs well USING C anyth.pdfactioncbe1
Hello guys! please make sure program runs well
USING C anything else
If you are not sure about it please dont send it out
Through this programming assignment, the students will learn to do the following: 1. Practice
processing command line arguments. 2. Perform basic file I/O. 3. Use structs, pointers, and
strings. 4. Use dynamic memory. This assignment asks you to create a doubly linked list which will
be used to sort the words in an input file and print the sorted words to an output file (or standard
output) which will be the solution. Your program, called doublesort, will take the following
command line arguments: % doublesort [d] [-o output_file_name] input_file_name Read the words
in from the input file one at a time. Convert all the letters to lower case. Skip any punctuation or
special characters. If the output_file_name is given with the -o option, the program will output the
sorted letters to the given output file; otherwise, the output shall be to standard output. In addition
to parsing and processing the command line arguments, your program needs to do the following:
1. You need to construct a doubly linked list as you read from input. Each node in the list will link
to the one in front of it and the one behind it if they exist. They will have NULL for the previous
pointer if they are first in the list. They will have NULL for the next pointer if they are last in the list.
You can look up doubly linked lists in your Data Structure textbook. 2. Initially the list is empty. The
program reads from the input file one word at a time and converts it to lower case. Create a node
with a pointer to the word and 2 pointers to nodes, previous and next. Initially the previous and
next pointers should be NULL. 3. As long as you continue reading words, if the word is not already
in the list, create a new node and place the node into the list in the proper alphabetical order. If
there is a node in front of it, adjust the next pointer of that node to point to the new node and make
the previous pointer of the new node to point to the node in front of it. If there is a node after it then
adjust those pointers as well so the list remains continuous. All duplicate words are ignored. 4. An
end of file would indicate the end of input from the input file. 5. Once the program has read all the
input, the program then performs a traversal of the doubly linked list first to last, or last to first if the
- d option is set, to print one word at a time to the output file or stdout. Print one word per3. As
long as you continue reading words, if the word is not already in the list, create a new node and
place the node into the list in the proper alphabetical order. If there is a node in front of it, adjust
the next pointer of that node to point to the new node and make the previous pointer of the new
node to point to the node in front of it. If there is a node after it then adjust those pointers as well
so the list remains continuous. All duplicate words are igno.
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Joachim Jacob
This is part 5 of the training "introduction to linux for bioinformatics". Here we introduce more advanced use on the command line (piping, redirecting) and provide you a selection of GNU text mining and analysis tools that assist you tremendously in handling your bioinformatics data. Interested in following this training session? Contact me at http://www.jakonix.be/contact.html
You must implement the following functions- Name the functions exactly.docxSebastian6SWSlaterb
You must implement the following functions. Name the functions exactly as instructed below, and provide the same arguments and call them in the same context as instructed. Failure to do so will result in points being deducted. You can use default or non-defualt variables, See lecture 06: 1. Write a function (call it get filehandle, and implement it as the same as above) 2. Write a function (call it get_fasta_lists, and implement it as the same as above) 3. Write a function (call it _verify_1ists, and implement it as the same as above) 4. Write a function (call it output_seq _statistics) that recelves three arguments. 1). The header list found in step 2 directly above. 2). The sequence list found in step 2 directly above. 3). The output filehandle the stats will be written too. This is the main function of this program, since it will print the top line of the output (see below), and esch sequence's numerical values. It will call two helper functions (_get__nebi_aceession and _get_num_nueleotides - see below) that will be called for each sequence prior to printing the data for each soquence out. I can call this function like this: 9 bend of the diat 1 process the sequencen and print out the data output_seq_atatiatics (1itt_headera, 1itht_segs, ih_out) 5. Write a function (call it _get_num_nucleotides) that recelves two arguments. 1). The character to find the occurrence of in the dna sequence, 2), The sequence data for that entry (string). I can call this function like this: a n t = get_num_nueleotides ( A , aeq) c n t = g e t num_nucleotides ( C , seq) The function should only take A , G , C , T , or N. If any other character is given other than that set, it should sys. exit ("Did not code this condition ") the program. Example, if I called this function like:_get__ _um_nucleotides (' Y ', seg) the function would sys, exit("Did not code this condition") 1. Write a function (call it get filehandle) that receives two arguments: 1). A file name 2), How to open a file for reading or writing ("r", or "w") in Python. The purpose of this function is to open the file name passed in, and passes back a a file object, aka the file handie or handle. You can call this function like this: \[ \begin{array}{l} \text { fh_in = get_filehandle }\left\{f i l e \_t o \_o p e n, " r *\right) \text { or } \\ \text { fh_out = get_filehandle(file_to_write, "w") } \end{array} \] When using open (), make sure to use try .. except .. except if the open was not successful the program should raise the right Exception(it should raise an oskmor si for when the file cannot be opened, and raise a valueEror se. when the wrong argument was passed for the opening mode, e.g. "mr" instead of " r "). We will test for things like a file that does not exist for opening, or the wrong open mode, e.g. mode='m'. See poan B for more information. All opening and closing of files in your program should use the get_filehandle function. Failure to do so will loose points. Make sure to dose yo.
Must be similar to screenshotsI must be able to run the projects.docxherthaweston
Must be similar to screenshots
I must be able to run the projects on Eclipse so that I can upload the codes to my Github account
The projects must say that they were created by
Juliet Mercado
Zachary Willis
Ihor Panchenko
Craig Anderson
Building a Search Engine, Part I: Governance, Workflow, and UI
(This is the first project in this series)
You are going to design, build, and test a scaled-down version of “Google Search”. Rather than searching the Internet's files, you will only search local files added to your search engine's index. Your search engine will allow an administrator to add, update, and remove files from the index. Users will be able to enter search terms, and select between Boolean AND, OR, or PHRASE search. The matching file names (if any) are then displayed in a list.
You also need to design the system architecture (the high-level design), so you can plan each part.
Search Engine Project Proposal:
Build a search engine with simple GUI, that can do AND, OR, and PHRASE Boolean searches on a small set of text files. The user should be able to say the type of search to do, and enter some search terms. The results should be a list of file pathnames that match the search. This should be a stand-alone application
User Interfaces
In addition to the main user interface (for doing searching), you will need a separate administrator or maintenance interface to manage your application. It should be easy to add and remove files (from the set of indexed files), and to regenerate the index anytime. When starting, your application should check if any of the files have been changed or deleted since the application last saved the index. If so, the administrator should be able to have the index updated with the modified file(s).
Note that with HTML, Word, or other types of documents, you would need to extract a plain text version before indexing. That isn't hard, but the search engine is complex enough already. For these projects, limit your search engine to only plain text files (including .txt, .html, and other text files).
The index must be stored on disk, so next time your application starts it can reload its data. The index, list of files, and other data, can be stored in one or more file(s) or in a database. The saved data should be read whenever your application starts. The saved data should be updated (or recreated) when you add, update, or remove documents from your set (of indexed documents), or perhaps just when your application exits. If you use files, the file formats are up to you; have a format that is fast and simple to load and store.
To keep things as simple as possible, in this project you can assume that only a small set of documents will be indexed, and thus the whole index can be kept in memory at once. (That's probably not the case for Google's data!) All you need to do is be able to read the index data from disk at startup into memory, and write it back either when updating the inde ...
Digital Forensic Examination Summary Report(for ALL lab assignme.docxlynettearnold46882
Digital Forensic Examination Summary Report
(for ALL lab assignments except Lab 0; remove red writing before submitting assignments)
Examiner: your name and company (simulated)
______________________________________________________________________________
Case Background: give an adequate description of the scenario as if the reader knows nothing about this case. why are you conducting this examination? who requested it? This should be more than 2-3 sentences. Use what's given to you in the lab scenario assignment to establish a quality case background.
______________________________________________________________________________
Legal Authority: (to conduct exam i.e. warrant, consent, government / organizational property. This must be always stated in a report):
______________________________________________________________________________
Tools Used:
for the readers sake who often are not technical, break up this section into subsections
Hardware
Software
(include full software versions (simulate when necessary); include hardware i.e. the system you used to conduct the examination with serial numbers (your desktop / laptop). Also, simulate using a hardware write-blocker if the scenario doesn't specify how the data is write protected.
A write-blocker prevents any writes to the media being examined so the examiner can acquire it safely without altering original evidence.)
______________________________________________________________________________
Initial Processing (show both acquisition and verification hash sums; list the media examined with description and serial number / see Addendum A) example verbiage: "The processing included inspection, photography, anti-virus scan, and the imaging laptop. The imaging of the media created forensic evidence files for use in the subsequent forensic examination. Methods were forensically sound and verifiable."
______________________________________________________________________________
Preliminary Findings: (out of analyzing X number of files, X were of forensic value; briefly describe the partition and file structure of the media examined; this is a synopsis of what you found of forensic value.)
______________________________________________________________________________
Detailed Findings: (this is where most or all of the case questions can be answered along with whatever else is required in the grading deliverables. This will always be the longest part of your report. If you feel that some detailed findings would be better placed in an Addendum, that's a good place too).
______________________________________________________________________________
Conclusions / Further Actions Required: (just state the facts; recommend what other devices could be examined to further the case; recommend interviews of subjects if applicable; are there protected files that need decryption?
Do not make judgment calls i.e. John Smith should be removed from his position; give the client the facts and let th.
Description 1) Create a Lab2 folder for this project2.docxtheodorelove43763
Description
1) Create a Lab2 folder for this project
2) Use the main driver program (called Writers.java) that I provide below to write files of differing types. You can copy and paste this code, but make sure the spaces variable copies correctly. The copy and paste operation eliminates the spaces between the quotes on some systems.
3) In the writers program, fill in the code for the three classes (Random, Binary, and Text). In each class, you will need a constructor, a write method, and a close method. The constructor opens the file, the write method writes a record, and the close method closes the file.
4) Other than what I just described, don't change the program in any way. The program asks for a file type (random, binary, or text) and the name of the file to create. In a loop it inputs a person's name (string), a person's age (int), and a person's annual salary (double). It writes to a file of the appropriate type. The loop terminates when the user indicates that inputting is complete. The program then asks if another file should be created. If the answer is yes, the whole process starts again. This and all of the java driver programs should be saved in your lab2 folder but not in the cs258 sub-folder.
5) Note: The method signatures for accessing all of the three types of files (binary, random, and text) are on the class web-site. Go to power point slides and click on week two. This will help if you didn't take accurate notes in class.
6) Write a main program to read binary files (BinReader.java). This program only needs to be able to read and display records from a Binary file that was created by the writers program.
7) Write a main program to read random files (RandReader.java). This program only needs to be able to read and display records from a Binary file that was created by the writers program. Make sure that this program reads and displays records in reverse order. DO NOT USE AN ARRAY!!!
8) In your Lab2 folder, create a subfolder within lab2 named cs258. Download Keyboard.java from the class web-site to that folder. Add a new first line of Keyboard.java with the statement, package cs258;. This line will make Keyboard.java part of the cs258 package. The driver program shown below has an import ‘cs258.*;’ statement to access the java files in this package.
9) Modify Keyboard.java. We want to extend this class so it can be extended to allow access to multiple files. The changes follow:
a. Remove all static references. This is necessary so that there will be an input stream variable (in) in each object.
b. Change the private modifier of the in and current_token variables to protected. Change the private modifier to protected in all of the signature lines of the overloaded getNextToken methods.
c. Create a constructor that instantiates the input stream for keyboard input. Remove the instantiation from the original declaration line for the in variable. The constructor doesn't need any parameters.
10)Create a class TextR.
Instructions Write a program whose main function is merely a.pdfadinathknit
Instructions
Write a program whose main function is merely a collection of variable declarations and function
calls. This program reads a text and outputs the letters, together with their counts, as explained
below in the function printResult. (There can be no global variables! All information must be
passed in and out of the functions. Use a structure to store the information.) Your program must
consist of at least the following functions:
Function openFile: Opens the input and output files. You must pass the file streams as parameters
(by reference, of course). If the file does not exist, the program should print an appropriate
message ("The input file does not exist.") and exit. The program must ask the user for the
names of the input and output files.
Function count: Counts every occurrence of capital letters A-Z and small letters a-z in the text file
opened in the function openFile. This information must go into an array of structures. The array
must be passed as a parameter, and the file identifier must also be passed as a parameter.
Function printResult: Prints the number of capital letters and small letters, as well as the
percentage of capital letters for every letter A-Z and the percentage of small letters for every letter
a-z. The percentages should look like this: "25%".This information must come from an array of
structures, and this array must be passed as a parameter.
Your program should prompt the user for name of the input file, then the name of the output file..
CDS Filtering is a little python program allowing you to filter your predicted ORFs, CDSs, RNA, or any other type of DNA or RNA sequences.
Download Link for CDS Filtering Program : https://goo.gl/RiAtC0
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docxannettsparrow
CS101 S. Thompson
University of Bridgeport Lab 7: Files, File Choosers, and Scanners
Lab 4_2 Files, File Choosers, and Scanners
There are two ways to identify a file in Java.
1. The name of a file
2. Using the File object. This is a type of object that describes a file as it is stored on the computer's file system. The file system is the system of directories (folders) that the operating system uses to organize stored files so users can find them easily.
Here we just need to know that when you use a file chooser (which we will discuss next) to locate a file in the file system, the file chooser gives you access to the file selected by the user through a File object. You can see an example of a Java file chooser dialog in action below.
Here the user has used the JFileChooser dialog box to navigate to the Documents folder and select a file named infix.txt.
To use a JFileChooser, you need to know about the following constructor and methods:
JFileChooser()
int showOpenDialog(Component owner)
File getSelectedFile()
Using a JFileChooser
Look up the JFileChooser documentation online so you know what package to import. To use it, create a JFileChooser object and then call its showOpenDialog(). If you have a GUI application, pass it the Component you want it to appear on top of. This will generally be the JFrame for your application. If you are using a console application, just pass it null. Calling this method will cause a dialog box like the one below to appear:
The user will use the dialog to navigate to some folder and select a file, and then click on the Open button to accept the selected file. If the user changes his (or her) mind, he or she can click on Cancel. Either, way, the showOpenDialog will return an integer to your program indicating the user's choice. If the the user selected a file, the method will return the value JFileChooser.APPROVE_OPTION. At this point, you can call the getSelectedFile() to retrieve a File object that you can use to access the file.
Here is example code for using a file chooser object.
File file = null;
JFileChooser chooser = new JFileChooser();
int result = chooser.showOpenDialog(null);
if (result == JFileChooser.APPROVE_OPTION)
file = chooser.getSelectedFile();
else
{
JOptionPane.showMessageDialog(null, "No file selected");
System.exit(1);
}
If this code does not exit, you will have a File object named file. Next, let us look at how you can use this object to open and read a text file using a Stream object named a FileReader.
FileReader
A FileReader object is used to read text files. Text files are files that are human-readable, usually created by a text editor such as Notepad. Many applications, for example MS Word, Excel, and Access, do not create text files. Instead, they create a different type of file named a binary file. You cannot use a FileReader to read a binary file.
If you look up the documentation for the FileRea.
Write a Fortran program to SOS take the name and ID number.pdfadvancesystem
Write a Fortran program to
SOS take the name and ID number of the user from keyboard entry,
create an external file and save it as Userlastillane IastzdigitsOtTD. bat ,
write into the created file: "This file was created for Userlame Develop your program based on
provided sample result below.
Sample result (green is keyboard entry).
Enter your first name.
John
Enter your last name.
Smith
Enter your ID number. (integer number only)
6789
Smith 89. txt must be created and include a single sentence..
Write a function that will take four parameters omega x0.pdfadvancesystem
Write a function that will take four parameters: omega , x0, phi, and a list of times; and which
outputs a list with the value of a harmonic oscillator at those times. i.e. it calculates x0cos(t+) for
all the t in the list. The following function rangef that generates a list of values between xmin and
xmax might be useful (it's the same one we just met in the def rangef (xmin,xmax,dx) : out =[]
steps = int ( round ((xxmaxxmin)/float(dx))) for step in range(steps ) : x= step*dx+xmin out.append
(x) return out def harmonic_oscillator (omega, x, phi, times): # write your code here.
More Related Content
Similar to Working with Dictionaries and ListsSets Modules you can use.pdf
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Joachim Jacob
This is part 5 of the training "introduction to linux for bioinformatics". Here we introduce more advanced use on the command line (piping, redirecting) and provide you a selection of GNU text mining and analysis tools that assist you tremendously in handling your bioinformatics data. Interested in following this training session? Contact me at http://www.jakonix.be/contact.html
You must implement the following functions- Name the functions exactly.docxSebastian6SWSlaterb
You must implement the following functions. Name the functions exactly as instructed below, and provide the same arguments and call them in the same context as instructed. Failure to do so will result in points being deducted. You can use default or non-defualt variables, See lecture 06: 1. Write a function (call it get filehandle, and implement it as the same as above) 2. Write a function (call it get_fasta_lists, and implement it as the same as above) 3. Write a function (call it _verify_1ists, and implement it as the same as above) 4. Write a function (call it output_seq _statistics) that recelves three arguments. 1). The header list found in step 2 directly above. 2). The sequence list found in step 2 directly above. 3). The output filehandle the stats will be written too. This is the main function of this program, since it will print the top line of the output (see below), and esch sequence's numerical values. It will call two helper functions (_get__nebi_aceession and _get_num_nueleotides - see below) that will be called for each sequence prior to printing the data for each soquence out. I can call this function like this: 9 bend of the diat 1 process the sequencen and print out the data output_seq_atatiatics (1itt_headera, 1itht_segs, ih_out) 5. Write a function (call it _get_num_nucleotides) that recelves two arguments. 1). The character to find the occurrence of in the dna sequence, 2), The sequence data for that entry (string). I can call this function like this: a n t = get_num_nueleotides ( A , aeq) c n t = g e t num_nucleotides ( C , seq) The function should only take A , G , C , T , or N. If any other character is given other than that set, it should sys. exit ("Did not code this condition ") the program. Example, if I called this function like:_get__ _um_nucleotides (' Y ', seg) the function would sys, exit("Did not code this condition") 1. Write a function (call it get filehandle) that receives two arguments: 1). A file name 2), How to open a file for reading or writing ("r", or "w") in Python. The purpose of this function is to open the file name passed in, and passes back a a file object, aka the file handie or handle. You can call this function like this: \[ \begin{array}{l} \text { fh_in = get_filehandle }\left\{f i l e \_t o \_o p e n, " r *\right) \text { or } \\ \text { fh_out = get_filehandle(file_to_write, "w") } \end{array} \] When using open (), make sure to use try .. except .. except if the open was not successful the program should raise the right Exception(it should raise an oskmor si for when the file cannot be opened, and raise a valueEror se. when the wrong argument was passed for the opening mode, e.g. "mr" instead of " r "). We will test for things like a file that does not exist for opening, or the wrong open mode, e.g. mode='m'. See poan B for more information. All opening and closing of files in your program should use the get_filehandle function. Failure to do so will loose points. Make sure to dose yo.
Must be similar to screenshotsI must be able to run the projects.docxherthaweston
Must be similar to screenshots
I must be able to run the projects on Eclipse so that I can upload the codes to my Github account
The projects must say that they were created by
Juliet Mercado
Zachary Willis
Ihor Panchenko
Craig Anderson
Building a Search Engine, Part I: Governance, Workflow, and UI
(This is the first project in this series)
You are going to design, build, and test a scaled-down version of “Google Search”. Rather than searching the Internet's files, you will only search local files added to your search engine's index. Your search engine will allow an administrator to add, update, and remove files from the index. Users will be able to enter search terms, and select between Boolean AND, OR, or PHRASE search. The matching file names (if any) are then displayed in a list.
You also need to design the system architecture (the high-level design), so you can plan each part.
Search Engine Project Proposal:
Build a search engine with simple GUI, that can do AND, OR, and PHRASE Boolean searches on a small set of text files. The user should be able to say the type of search to do, and enter some search terms. The results should be a list of file pathnames that match the search. This should be a stand-alone application
User Interfaces
In addition to the main user interface (for doing searching), you will need a separate administrator or maintenance interface to manage your application. It should be easy to add and remove files (from the set of indexed files), and to regenerate the index anytime. When starting, your application should check if any of the files have been changed or deleted since the application last saved the index. If so, the administrator should be able to have the index updated with the modified file(s).
Note that with HTML, Word, or other types of documents, you would need to extract a plain text version before indexing. That isn't hard, but the search engine is complex enough already. For these projects, limit your search engine to only plain text files (including .txt, .html, and other text files).
The index must be stored on disk, so next time your application starts it can reload its data. The index, list of files, and other data, can be stored in one or more file(s) or in a database. The saved data should be read whenever your application starts. The saved data should be updated (or recreated) when you add, update, or remove documents from your set (of indexed documents), or perhaps just when your application exits. If you use files, the file formats are up to you; have a format that is fast and simple to load and store.
To keep things as simple as possible, in this project you can assume that only a small set of documents will be indexed, and thus the whole index can be kept in memory at once. (That's probably not the case for Google's data!) All you need to do is be able to read the index data from disk at startup into memory, and write it back either when updating the inde ...
Digital Forensic Examination Summary Report(for ALL lab assignme.docxlynettearnold46882
Digital Forensic Examination Summary Report
(for ALL lab assignments except Lab 0; remove red writing before submitting assignments)
Examiner: your name and company (simulated)
______________________________________________________________________________
Case Background: give an adequate description of the scenario as if the reader knows nothing about this case. why are you conducting this examination? who requested it? This should be more than 2-3 sentences. Use what's given to you in the lab scenario assignment to establish a quality case background.
______________________________________________________________________________
Legal Authority: (to conduct exam i.e. warrant, consent, government / organizational property. This must be always stated in a report):
______________________________________________________________________________
Tools Used:
for the readers sake who often are not technical, break up this section into subsections
Hardware
Software
(include full software versions (simulate when necessary); include hardware i.e. the system you used to conduct the examination with serial numbers (your desktop / laptop). Also, simulate using a hardware write-blocker if the scenario doesn't specify how the data is write protected.
A write-blocker prevents any writes to the media being examined so the examiner can acquire it safely without altering original evidence.)
______________________________________________________________________________
Initial Processing (show both acquisition and verification hash sums; list the media examined with description and serial number / see Addendum A) example verbiage: "The processing included inspection, photography, anti-virus scan, and the imaging laptop. The imaging of the media created forensic evidence files for use in the subsequent forensic examination. Methods were forensically sound and verifiable."
______________________________________________________________________________
Preliminary Findings: (out of analyzing X number of files, X were of forensic value; briefly describe the partition and file structure of the media examined; this is a synopsis of what you found of forensic value.)
______________________________________________________________________________
Detailed Findings: (this is where most or all of the case questions can be answered along with whatever else is required in the grading deliverables. This will always be the longest part of your report. If you feel that some detailed findings would be better placed in an Addendum, that's a good place too).
______________________________________________________________________________
Conclusions / Further Actions Required: (just state the facts; recommend what other devices could be examined to further the case; recommend interviews of subjects if applicable; are there protected files that need decryption?
Do not make judgment calls i.e. John Smith should be removed from his position; give the client the facts and let th.
Description 1) Create a Lab2 folder for this project2.docxtheodorelove43763
Description
1) Create a Lab2 folder for this project
2) Use the main driver program (called Writers.java) that I provide below to write files of differing types. You can copy and paste this code, but make sure the spaces variable copies correctly. The copy and paste operation eliminates the spaces between the quotes on some systems.
3) In the writers program, fill in the code for the three classes (Random, Binary, and Text). In each class, you will need a constructor, a write method, and a close method. The constructor opens the file, the write method writes a record, and the close method closes the file.
4) Other than what I just described, don't change the program in any way. The program asks for a file type (random, binary, or text) and the name of the file to create. In a loop it inputs a person's name (string), a person's age (int), and a person's annual salary (double). It writes to a file of the appropriate type. The loop terminates when the user indicates that inputting is complete. The program then asks if another file should be created. If the answer is yes, the whole process starts again. This and all of the java driver programs should be saved in your lab2 folder but not in the cs258 sub-folder.
5) Note: The method signatures for accessing all of the three types of files (binary, random, and text) are on the class web-site. Go to power point slides and click on week two. This will help if you didn't take accurate notes in class.
6) Write a main program to read binary files (BinReader.java). This program only needs to be able to read and display records from a Binary file that was created by the writers program.
7) Write a main program to read random files (RandReader.java). This program only needs to be able to read and display records from a Binary file that was created by the writers program. Make sure that this program reads and displays records in reverse order. DO NOT USE AN ARRAY!!!
8) In your Lab2 folder, create a subfolder within lab2 named cs258. Download Keyboard.java from the class web-site to that folder. Add a new first line of Keyboard.java with the statement, package cs258;. This line will make Keyboard.java part of the cs258 package. The driver program shown below has an import ‘cs258.*;’ statement to access the java files in this package.
9) Modify Keyboard.java. We want to extend this class so it can be extended to allow access to multiple files. The changes follow:
a. Remove all static references. This is necessary so that there will be an input stream variable (in) in each object.
b. Change the private modifier of the in and current_token variables to protected. Change the private modifier to protected in all of the signature lines of the overloaded getNextToken methods.
c. Create a constructor that instantiates the input stream for keyboard input. Remove the instantiation from the original declaration line for the in variable. The constructor doesn't need any parameters.
10)Create a class TextR.
Instructions Write a program whose main function is merely a.pdfadinathknit
Instructions
Write a program whose main function is merely a collection of variable declarations and function
calls. This program reads a text and outputs the letters, together with their counts, as explained
below in the function printResult. (There can be no global variables! All information must be
passed in and out of the functions. Use a structure to store the information.) Your program must
consist of at least the following functions:
Function openFile: Opens the input and output files. You must pass the file streams as parameters
(by reference, of course). If the file does not exist, the program should print an appropriate
message ("The input file does not exist.") and exit. The program must ask the user for the
names of the input and output files.
Function count: Counts every occurrence of capital letters A-Z and small letters a-z in the text file
opened in the function openFile. This information must go into an array of structures. The array
must be passed as a parameter, and the file identifier must also be passed as a parameter.
Function printResult: Prints the number of capital letters and small letters, as well as the
percentage of capital letters for every letter A-Z and the percentage of small letters for every letter
a-z. The percentages should look like this: "25%".This information must come from an array of
structures, and this array must be passed as a parameter.
Your program should prompt the user for name of the input file, then the name of the output file..
CDS Filtering is a little python program allowing you to filter your predicted ORFs, CDSs, RNA, or any other type of DNA or RNA sequences.
Download Link for CDS Filtering Program : https://goo.gl/RiAtC0
CS101S. ThompsonUniversity of BridgeportLab 7 Files, File.docxannettsparrow
CS101 S. Thompson
University of Bridgeport Lab 7: Files, File Choosers, and Scanners
Lab 4_2 Files, File Choosers, and Scanners
There are two ways to identify a file in Java.
1. The name of a file
2. Using the File object. This is a type of object that describes a file as it is stored on the computer's file system. The file system is the system of directories (folders) that the operating system uses to organize stored files so users can find them easily.
Here we just need to know that when you use a file chooser (which we will discuss next) to locate a file in the file system, the file chooser gives you access to the file selected by the user through a File object. You can see an example of a Java file chooser dialog in action below.
Here the user has used the JFileChooser dialog box to navigate to the Documents folder and select a file named infix.txt.
To use a JFileChooser, you need to know about the following constructor and methods:
JFileChooser()
int showOpenDialog(Component owner)
File getSelectedFile()
Using a JFileChooser
Look up the JFileChooser documentation online so you know what package to import. To use it, create a JFileChooser object and then call its showOpenDialog(). If you have a GUI application, pass it the Component you want it to appear on top of. This will generally be the JFrame for your application. If you are using a console application, just pass it null. Calling this method will cause a dialog box like the one below to appear:
The user will use the dialog to navigate to some folder and select a file, and then click on the Open button to accept the selected file. If the user changes his (or her) mind, he or she can click on Cancel. Either, way, the showOpenDialog will return an integer to your program indicating the user's choice. If the the user selected a file, the method will return the value JFileChooser.APPROVE_OPTION. At this point, you can call the getSelectedFile() to retrieve a File object that you can use to access the file.
Here is example code for using a file chooser object.
File file = null;
JFileChooser chooser = new JFileChooser();
int result = chooser.showOpenDialog(null);
if (result == JFileChooser.APPROVE_OPTION)
file = chooser.getSelectedFile();
else
{
JOptionPane.showMessageDialog(null, "No file selected");
System.exit(1);
}
If this code does not exit, you will have a File object named file. Next, let us look at how you can use this object to open and read a text file using a Stream object named a FileReader.
FileReader
A FileReader object is used to read text files. Text files are files that are human-readable, usually created by a text editor such as Notepad. Many applications, for example MS Word, Excel, and Access, do not create text files. Instead, they create a different type of file named a binary file. You cannot use a FileReader to read a binary file.
If you look up the documentation for the FileRea.
Write a Fortran program to SOS take the name and ID number.pdfadvancesystem
Write a Fortran program to
SOS take the name and ID number of the user from keyboard entry,
create an external file and save it as Userlastillane IastzdigitsOtTD. bat ,
write into the created file: "This file was created for Userlame Develop your program based on
provided sample result below.
Sample result (green is keyboard entry).
Enter your first name.
John
Enter your last name.
Smith
Enter your ID number. (integer number only)
6789
Smith 89. txt must be created and include a single sentence..
Write a function that will take four parameters omega x0.pdfadvancesystem
Write a function that will take four parameters: omega , x0, phi, and a list of times; and which
outputs a list with the value of a harmonic oscillator at those times. i.e. it calculates x0cos(t+) for
all the t in the list. The following function rangef that generates a list of values between xmin and
xmax might be useful (it's the same one we just met in the def rangef (xmin,xmax,dx) : out =[]
steps = int ( round ((xxmaxxmin)/float(dx))) for step in range(steps ) : x= step*dx+xmin out.append
(x) return out def harmonic_oscillator (omega, x, phi, times): # write your code here.
Write a function that will take four parameters omega p.pdfadvancesystem
Write a function that will take four parameters: omega , ,phi, and a list of times; and which outputs
a list with the value of a harmonic oscillator at those times. i.e. it calculates x0cos(t+) for all the t in
the list.| The following function rangef that generates a list of values between xmin and x max
might be useful (it's the same one we just met in the notes)..
Write a generalpurpose program with loop and indexed addres.pdfadvancesystem
Write a general-purpose program with loop and indexed addressing
that adds 12h to 0th, 3rd , 7th , 11th ,15th ,19th , elements of a DWORD array.
For example, in array:
Array1 DWORD 12h, 13h, 14h,15h, 16h, 17h, 18h, 19h, 1ah, 1bh, 1ch, 1dh, 1eh, 1fh
becomes:
Array1 : 24h, 13h, 14h, 27h,16h,17h,18h, 2bh, 1ah, 1bh, 1ch, 2f, 1eh, 1fh
ONLY USE: "MOV" "JMP" "LOOP" "LAHF" "SAHF" "XCHG" "INC" "DEC" "ADD" "SUB" "NEG"
Instructions, otherwise I will thumb down..
Write a computer program in JAVA that hides a secret message.pdfadvancesystem
Write a computer program in JAVA that hides a secret message within an image file using
steganography. Your program should prompt the user for the path of the image file and the secret
message to hide, and then modify the image file by hiding the message within it. The program
should also have a function to retrieve the hidden message from the image file. Explain your code..
Write a Fortran program to 1 take the name and ID number of.pdfadvancesystem
Write a Fortran program to 1- take the name and ID number of the user from keyboard entry, 2-
create an external file and save it as useriastivame_Last2digitsofid.txt , 3- write into the created
file: "This file was created for UserName ." . Develop your program based on provided sample
result below: Smith_89.txt Smith_89. txt must be created and include a single sentence. This file
was created for John Smith..
Write a function called ApologyLine that take an integer c a.pdfadvancesystem
Write a function called ApologyLine that take an integer c and print message Sorry c times in a line
without space/new line. Please use single lower case letter as parameter name. #include using
namespace std; // function ApologyLine Line {{ for ( cout <; return; } int main 0{ int x=2
ApologyLine(x);//print SorrySorry return 0 }.
Write a C++ code that makes pyramid shape as long as user wa.pdfadvancesystem
Write a C++ code that makes pyramid shape as long as user wants (take input from user ). Use
only nested for loop . Similarly write a code for inverted shape of pyramid and similarly take input
from user (how long it is , depends on user). Then write a code that makes pyramid shape but
hollow from inside (take input from user) See the attach picture in following.
Assignonent :.
Write a class called Window that contains the following info.pdfadvancesystem
Write a class called Window that contains the following information: 1. Private instance variables
for the height and width of the window (int). 2. A two-argument constructor to set each of the
instance variables above. If the height or width is negative, throw an IllegalArgumentException
stating the argument that is not correct. 3. Get and Set methods for each instance variable with the
same error detection as the constructor. public class Window {.
Write a C code that uses struct to create a userdefined typ.pdfadvancesystem
Write a C code that uses struct to create a user-defined type person with the following attributes:
char name [ int age double height double weight In your code declare a variable of type person
and initialize the attributes appropriately. Print your variable to the terminal using printf. A
suggested printout could be: John is 1.75mtall, aged 24 , and weighs 80kg Remember to #include
the necessary header files if they have not been included when you start a project in eclipse IDE.
There is nothing to submit for this task. But the skill will be needed later..
Write a 12 page report on igneous rock and how they are m.pdfadvancesystem
Write a 1-2 page report on igneous rock and - how they are made - What they are made of -
percentages of minerals? How do you know those minerals are there? - Discussion of the
processes which formed your rock is absent - Igneous rock's texture and composition - describe
and explain the process that likely formed the igneous rock, along with the likely environment
and/or tectonic setting. - Discussion of the processes which occurred to your rock after its
formation is absent. E.g., what geologic processes acted on the rock and led to its present-day
position in the landscape, ect. - Reflect on the geological processes that brought the rock to a
place in which humans could access it. Asap please..
WQ4 Coevolution of Central American ants in the Pseudomyrme.pdfadvancesystem
WQ4. Coevolution of Central American ants in the Pseudomyrmex ferrugineus group and swollen-
thorn acacias (Vachellia species) is a type of ____, because _____.
Group of answer choices
adaptation; the Vachellia species develop swollen thorns for the ants to eat.
mutualism; ants receive nesting space in the form of swollen thorns and food from nectaries and
leaf-tip food bodies, and Vachellia trees receive protections from ants by removing or repelling
herbivores and competing plants.
natural selection; ants find the swollen thorn of Vachellia perfect nesting space.
mosaic; ants damage the swollen thorn of Vachellia while nesting and the trees kill the ants with
their sharp thorns..
With the following companies Apple Caterpillar Consolidat.pdfadvancesystem
With the following companies (Apple, Caterpillar, Consolidated Edison, Northern Trust, Macy's)
and market analysis in mind, construct a complete portfolio that includes the following:
Compare the risk/return trade-off on the investments. Keep in mind the rates of return for
shareholders on the proposed investment portfolio..
Would the current answer be considered correct 2 Identify .pdfadvancesystem
Would the current answer be considered correct?
2. Identify the remaining two characteristics for these horizontal fold axis folds as depicted in
roadside outcrop cross sections... Axial Plane...A (for upright), B (for inclined), C (for overturned).
D (for recumbent), Interlimb angle... E (for open), F (for gentle), G (for moderate), H (for tight), I
(for isoclinal).
WQ3 Considering that you know about natural selection is o.pdfadvancesystem
WQ3: Considering that you know about natural selection, is organ-level selection likely to exist?
Group of answer choices A.Yes, all 3 criteria are satisfied for selection among organs B.Yes,
because organs have their own rules C.No, because organs do not vary among individuals D.No,
because organs do not reproduce themselves E.No, because organs are not heritable over
generations.
would be earned How much of the total is simple interest an.pdfadvancesystem
would be earned? How much of the total is simple interest and how much results from
compounding of interest? If you deposit $15,000 today into an account earning an annual rate of
return of 10%, in the third year how much interest would be earned? (Round to the nearest cent.).
write 350400 WORDS AND EXPLAIN BRIEFLY lapter 7 How Touris.pdfadvancesystem
write 350-400 WORDS AND EXPLAIN BRIEFLY
lapter 7- How Tourism Works Attractions drive tourism and if a destination does not have a
sufficient breadth and depth of attractions it will struggle. Outline a region that is lacking in
attractions and provide 23 examples of how the region could develop its tourist sector..
World vegetation maps and world climate maps are very simila.pdfadvancesystem
World vegetation maps and world climate maps are very similar. Why? Because climate maps are
based on vegetation maps. Because vegetation maps are based on climate maps. Because
climate determines where you find different vegetation types. Because vegetation types determine
climate. 25 points The author states that he mapped the sols of New Brunswick, Canada using
aerial photographs. Why was he able to use aerial photographs to describe the distribution of
sols? He used ground penetration radar to "see" under the ground suiface. He could recognize the
major vegetation types from the aerial photographs and knew that each vegetason type grew in a
spocific soil type. He was too busy to do good joband basically only guessed the soilk- He could
see the soils from the air..
Working individually or in pairs you will apply what you ha.pdfadvancesystem
Working individually or in pairs, you will apply what you have learned about contracts and
employment law to a past situation between Dustin Byfuglien, the Winnipeg Jets defensemen and
the Winnipeg Jets organization using only the information below. Background Story In 2019, the
Winnipeg Jets and Dustin Byfuglien went before an arbitrator (retired Judge) to discuss if Byfuglien
should be paid his $8 million USD salary as he was injured. There were a few issues at play here
for the arbitrator to use for a judgement. - The team doctor and Byfuglien signed off a document
stating that Dustin was healthy at the end of the season in May 2019. Every player has to sign off
on the physical as well as the doctor. Both Byfuglien and the doctor signed off meaning that at the
end of the season, he was deemed healthy. - In August 2019, Byfuglien returned to Winnipeg and
asked Jets management for time to think about his playing future. He did not report to training
camp and the Jets gave him the time and space he needed to make his decision. - Several weeks
passed without any commitment from Dustin. The Jets then suspended him without pay at the
start of the 2019 season in October. The Jets did this for salary cap reasons and because you
cannot pay someone who has not reported to work. - Unknow to the Jets, Byfuglien independently
went and had ankle surgery the summer of 2019. He told the Jets about the surgery after the
operation. He also said his foot was broken and the team did not know about it nor did he tell
them. As far as the timeline goes, it seems like the Jets were set on giving Byfuglien the time and
space needed to make an informed decision about his future. There is no evidence that Byfuglien
did not re-injure his ankle or break his foot over the 2019 summer. An aside about ankles: people
with a history of ankle injuries may need to go physio more than once. With a bad sprain, at some
point the joint is compromised and the ankle is permanently damaged and will always sprain/roll
easily now. If this is the case with Byfuglien, and we don't know the nature of his ankle injury, this
could be why Byfuglien developed more ankle issues over the summer or his ankle never fully
healed. Byfuglien's lawyer had argued in arbitration that Byfuglien was not suspended because he
was injured, but because he did not report for training camp. Had he reported to training camp and
then told the Jets his ankle was bothering him, he would have been fine. The suspendable act was
not showing up. Byfuglien wanted to get paid, but the facts are he did not show up at camp and to
top it off, he got surgery on his ankle without telling the Jets.5. Was Dustin on strike or was it
implied repudiation or neither? Did the Jets lock him out in this dispute? (2 marks) 6. As the
arbitrator, make your decision and explain why? Give two specific legal reasons with details (4
marks).
Without using a function write the JavaScript code so that w.pdfadvancesystem
Without using a function write the JavaScript code so that when you to mouse over the image
of A, both the image of B and the image of A are replaced by an image of a C.
DO NOT USE A FUNCTION CALL
Hint: You will need two complete statements to change two images and will use this.src and
getElementById(the id goes here).src (.src is for images).
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Working with Dictionaries and ListsSets Modules you can use.pdf
1. Working with Dictionaries and Lists/Sets
Modules you can use:
argparse, reLinks, osLinks, collectionsLinks, sysLinks
General Guidelines (Steps 1-6)
You have more flexibility to implement your own function names and logic in these programs.
The data files you need for this assignment can obtained from:
HUGO_genes.txt, chr21_genes.txt
Create an output directory inside your assignment4 directory called "OUTPUT" for result files, so
that they will not mix with your programs. Output from your programs will be here!
Pay close attention to how you'll run the run_lints.sh script (see below)
Your program must implement command line options for the infiles it must open, but for
testing purposes it should run by default, so if no command line option is passed at the command
line, the program will still run. This will help in the grading of your program.
Create a Python Module called called io_utils.py. Put this io_utils.py Module in a subdirectory
named assignment4 inside your assignment4 top-level directory (see the tree below). Anytime a
file needs to be opened (read or write) in your programs in this assignment, the program should
call on this module's function get_filehandle. You can then use io_utils.get_filehandle by doing
this at the top of your programs:
from assignment4 import io_utils
# I can then use the module's get_filehandle() function by:
fh_in = io_utils.get_filehandle(infile1, "r") # note the function call "io_utils.get_filehandle()"
You can also import this way (Either way is acceptable, but I will assume in this assignment you
did it the way below. I think this is better for Pycharm)
from assignment4.io_utils import get_filehandle
# I can then use the module's get_filehandle() function by:
fh_in = get_filehandle(infile1, "r") # note the function call "get_filehandle()"
Your final submission must have the following files in bold and must use this directory structure.
Make sure you put a blank __init__.py where I've denoted below, e.g.: assignment4/
assignment4 (see below)
Make sure you have __init__.py only in assignment4/assignment4 folder, the tests folder, the unit
folder, and not in the assignment4 main folder.
Information on Source files
The chr21_genes.txt file lists genes from human chromosome 21, in their order along the
chromosome, as described in Hattori et al. (Nature 405, 311-319)Links to an external site.. For
each gene, the file gives the gene symbol, description and category. The fields are separated by
tabs. You will need to get the the meaning of each category. You can find these meanings in the
original paperLinks to an external site., under the "Gene categories" section. Create a file named
2. chr21_genes_categories.txt that store this information in tab separated fields:
This will be used in program #2
The HUGO_genes.txt file lists all human genes having official symbol approved by the HUGO
gene nomenclature committeeLinks to an external site. (some have probably changed by now).
For each gene, the file gives its symbol and description, separated by a TAB character.
Exercises
1. Write a program (call it gene_names_from_chr21.py) that asks the user to enter a gene
symbol and then prints the description for that gene based on data from the chr21_genes.txt file.
The program should give an error message if the entered symbol is not found in the table (the user
should should not have to worry about case, i.e. it will be a case-insensitive search). The program
should continue to ask the user for genes until "quit" or "exit" is given (case-insensitive). Make
sure to prompt the user to enter the quit to end the program. Use Dictionaries to solve this
problem. HINT: Feel free to use as Dictionary of Dictionaries, but it is not required.
HINT: First read the entire text file into a Dictionary that maps the association between gene
symbol and description. Once again, make sure to use a Dictionary.
Remember to have these command line options:
$ python3 gene_names_from_chr21.py -i chr21_genes.txt
Output from this program should just go to <STDOUT>:
2. Write a program (call it find_common_cats.py) that counts how many genes are in each
category (1.1, 1.2, 2.1 etc.) based on data from the chr21_genes.txt file. The program should print
the results so that categories are arranged in ascending order to an output file (call the output
output OUTPUT/categories.txt . Read the paper to see what the categories represent and have
this part of your output (this will be input from chr21_genes_categories.txt). Use Dictionaries to
solve this problem. HINT: Feel free to use as Dictionary of Dictionaries, but it is not required.
Note: you will notice that one gene has no category information. That's due to missing data in the
file, JUST IGNORE THIS GENE!.
Remember to have these command line options:
$ python3 find_common_cats.py -i1 chr21_genes.txt -i2 chr21_genes_categories.txt
Output to the file (OUTPUT/categories.txt) from this program:
Note <Occurrence Here> is a number
3. Write a program (call it intersection_of_gene_names.py) that finds all gene symbols that
appear both in the chr21_genes.txt file and in the HUGO_genes.txt file. These gene symbols
should be printed to a file in alphabetical order (you can hard code the output file
OUTPUT/intersection_output.txt) . The program should also print on the terminal how many
common gene symbols were found. Use Lists or Sets to solve the problem. It is fine to use a
temporary Dictionary to find the intersection of two Lists, but this can be simplified with Sets. Note:
HUGO_genes.txt could have some duplicate entries.
Remember to have these command line options:
$ python3 intersection_of_gene_names.py -i1 chr21_genes.txt -i2 HUGO_genes.txt # the N
's below are an integer and bolded for illustration only
3. Number of unique gene names in chr21_genes.txt: N
Number of unique gene names in HUGO_genes.txt: N
Number of common gene symbols found: N
Output stored in OUTPUT/intersection_output.txt
STDOUT is shown above, and the actual output of the intersection goes to the file (
OUTPUT/intersection_output.txt) from this program:
If you implemented intersection_of_gene_names.py correctly, this program could take any gene
file that has the gene in the first column (even if it's the only column)
(additional examples: hgnc_complete_set_reduced.txtLinks to an external site. and
gene_age.txtLinks to an external site.)
$ python3 intersection_of_gene_names.py -i1 hgnc_complete_set_reduced.txt -i2
HUGO_genes.txt
Number of unique gene names in hgnc_complete_set_reduced.txt: 43547
Number of unique gene names in HUGO_genes.txt: 11815
Number of common gene symbols found: 8654
Output stored in OUTPUT/intersection_output.txt
$ python3 intersection_of_gene_names.py -i1 gene_age.txt -i2 chr21_genes.txt
Number of unique gene names in gene_age.txt: 307
Number of unique gene names in chr21_genes.txt: 285
Number of common gene symbols found: 4
Output stored in OUTPUT/intersection_output.txt
You must solve exercises 1 and 2 by using Dictionaries, and exercise 3 using Lists or Sets