-
Notifications
You must be signed in to change notification settings - Fork 10
Tutorial 7 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
amidlige
wants to merge
16
commits into
lyy005:master
Choose a base branch
from
amidlige:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Tutorial 7 #3
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0fcc609
Add files via upload
amidlige a05d8b5
Q1 finished
aguinness ce2280a
Tut7 updated
aguinness 61144b5
Merge branch 'master' of https://github.com/amidlige/Intro_Biocom_ND_…
aguinness 86af837
Add files via upload
amidlige 9c8d347
Data used for parts 2 and 3
amidlige 042c1f9
Cleaned up .py Script
aguinness fef2849
Merge branch 'master' of https://github.com/amidlige/Intro_Biocom_ND_…
aguinness 3f1532f
barplot
aguinness a7f6212
Scatter Plot
mbuynak b671c0f
Scatter & Bar Plot Visuals
mbuynak a9afa29
Delete 117911-19761-4fe6xm.gj4apaxlxr.png
mbuynak 7570dfd
Scatter and Bar Plot Visuals
mbuynak b263696
Delete Bar Plot.png
mbuynak 70f9c77
Bar Plot Visual
mbuynak a482694
Scatter Plot
mbuynak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import os | ||
| from plotnine import * | ||
| from matplotlib import pyplot as plt | ||
| import numpy as np | ||
| import pandas | ||
|
|
||
| os.chdir("Intro_Biocom_ND_319_Tutorial7/") | ||
|
|
||
| fasta = open("Lecture11.fasta", "r") | ||
|
|
||
| sequenceID=[] | ||
| sequenceLength=[] | ||
| percentGC=[] | ||
| meltingTemp = [] | ||
|
|
||
| for Line in fasta: | ||
| Line = Line.strip() | ||
| if '>' in Line: | ||
| sequenceID.append(Line[1:]) | ||
| else: | ||
| seqLen=float(len(Line)) | ||
|
|
||
| if seqLen <= 14: | ||
| Tm=2*(nG+nC)+2*seqLen | ||
| else: | ||
| Tm=-9999 | ||
|
|
||
| nG=Line.count("G") | ||
| nC=Line.count("C") | ||
|
|
||
|
|
||
| sequenceLength.append(seqLen) | ||
| percentGC.append((nG+nC)/seqLen*100) | ||
| meltingTemp.append(Tm) | ||
|
|
||
|
|
||
| plt.hist(percentGC, bins = 11) | ||
| plt.title('Percent GC content distribution') | ||
| plt.xlabel('GC Content (%)') | ||
| plt.ylabel('count') | ||
|
|
||
| plt.show() | ||
|
|
||
| plt.hist(sequenceLength, bins = 24) | ||
| plt.title('Sequence Length distribution') | ||
| plt.xlabel('Sequence Length') | ||
| plt.ylabel('count') | ||
|
|
||
| plt.show() | ||
|
|
||
| InFile.close() | ||
|
|
||
| ## Question 3 Starts Here ## | ||
|
|
||
| data = pandas.read_csv("data.txt", sep = ",") | ||
|
|
||
|
|
||
| plot = ggplot(data, aes(y = "observations", x = "region")) | ||
| plot + geom_bar(stat="summary", fun_y = np.mean, fill = "green") | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import os | ||
| from plotnine import * | ||
| from matplotlib import pyplot as plt | ||
| import numpy as np | ||
| import pandas | ||
|
|
||
|
|
||
| data = pandas.read_csv("data.txt", sep = ",") | ||
|
|
||
|
|
||
| plot = ggplot(data, aes(y = "observations", x = "region")) | ||
| plot + geom_jitter(colour='black') | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import pandas | ||
| import numpy | ||
|
|
||
| InFile=open("Lecture11.fasta","r") | ||
|
|
||
| A = numpy.zeros((100,4)) #tells python how big we want the table to be. | ||
| B = pandas.DataFrame(A,columns=['seqNum','seqLength','Gcontent','Ccontent']) #labels each column | ||
|
|
||
| for line in InFile: | ||
| Line=Line.strip() | ||
| if '>' in Line: | ||
|
|
||
| else: | ||
| seqLen=float(len(Line)) | ||
| seqLen=B.iloc[i,1] | ||
|
|
||
| nG=Line.count("G") | ||
| nG=B.iloc[i,2] | ||
|
|
||
| nC=Line.count("C") | ||
| nC=B.iloc[i,3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import pandas | ||
| import matplotlib.pyplot as plt | ||
|
|
||
| df = pandas.read_excel('patentsPerYear.xlsx') | ||
|
|
||
| data= df[['Calendar Year','Utility Patent Application (Inventions)']] | ||
| x=data['Calendar Year'] | ||
| y=data['Utility Patent Application (Inventions)'] | ||
| plt.scatter(x,y) | ||
|
|
||
| z = np.polyfit(x, y, 1) | ||
| p = np.poly1d(z) | ||
| plt.plot(x,p(x),"r--") | ||
|
|
||
| plt.show() | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job |
||
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job