Skip to content
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

PTM-Summarizer_Version1.0 #2

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
661260d
Create LICENSE
chinmayaNK22 Jul 9, 2021
940d707
Create HumanRefSeq_GCF_000001405.39_GRCh38.p13_protein_refseq109_form…
chinmayaNK22 Jul 9, 2021
933be78
Create Modified_Proteins.py
chinmayaNK22 Jul 9, 2021
85d4413
Create SARS_CoV2_Mulit-PTM_PSMs_PTMs.txt
chinmayaNK22 Jul 9, 2021
8ea732e
Delete Modified_Proteins_new_063021.py
chinmayaNK22 Jul 9, 2021
e629d48
Update README.md
chinmayaNK22 Jul 9, 2021
f3d71f2
Delete PTM_ProAdvanced.pl
chinmayaNK22 Jul 9, 2021
aa445e4
Create PTM_summarizer.pl
chinmayaNK22 Jul 9, 2021
9f48eb1
Merge branch 'PTM-Summarizer_V1' of https://github.com/chinmayaNK22/P…
chinmayaNK22 Jul 9, 2021
470559b
Update PTM_summarizer.pl
beherasan Jul 9, 2021
95bdd14
Update PTM_summarizer.pl
beherasan Jul 9, 2021
25120a7
Update Modified_Proteins.py
chinmayaNK22 Jul 9, 2021
3ce8a5e
Create PTM_summarizer.py
chinmayaNK22 Jul 9, 2021
48c8d55
Update PTM_summarizer.pl
chinmayaNK22 Jul 9, 2021
236ba76
Merge branch 'PTM-Summarizer_V1' of https://github.com/chinmayaNK22/P…
chinmayaNK22 Jul 9, 2021
34d40e9
Update README.md
chinmayaNK22 Jul 9, 2021
25372eb
Update README.md
chinmayaNK22 Jul 9, 2021
312bce6
Create modified_proteins_summ.cpython-37.pyc
chinmayaNK22 Jul 9, 2021
460ec85
Create ForUpset.txt
chinmayaNK22 Jul 9, 2021
742b2b8
Update HumanRefSeq_GCF_000001405.39_GRCh38.p13_protein_refseq109_form…
chinmayaNK22 Jul 9, 2021
efca138
Delete Modified_Proteins.py
chinmayaNK22 Jul 9, 2021
688e81b
Create modified_proteins_summ.py
chinmayaNK22 Jul 9, 2021
2f0fce6
Update PTM_summarizer.py
chinmayaNK22 Jul 9, 2021
3164633
Merge branch 'PTM-Summarizer_V1' of https://github.com/chinmayaNK22/P…
chinmayaNK22 Jul 9, 2021
f716fa9
Update PTM_summarizer.py
chinmayaNK22 Jul 9, 2021
c87e2e7
Delete ForUpset.txt
chinmayaNK22 Jul 9, 2021
dc23115
Update modified_proteins_summ.cpython-37.pyc
chinmayaNK22 Jul 10, 2021
c97ed64
Create HumanRefSeq_GCF_000001405.39_GRCh38.p13_protein_refseq109_form…
chinmayaNK22 Jul 10, 2021
e38c7b0
Create HumanRefSeq_GCF_000001405.39_GRCh38.p13_protein_refseq109_form…
chinmayaNK22 Jul 10, 2021
54224b3
Update modified_proteins_summ.py
chinmayaNK22 Jul 10, 2021
5f663c3
Update HumanRefSeq_GCF_000001405.39_GRCh38.p13_protein_refseq109_form…
chinmayaNK22 Jul 10, 2021
d33e8df
Delete HumanRefSeq_GCF_000001405.39_GRCh38.p13_protein_refseq109_form…
chinmayaNK22 Jul 10, 2021
ed04f85
Delete HumanRefSeq_GCF_000001405.39_GRCh38.p13_protein_refseq109_form…
chinmayaNK22 Jul 10, 2021
5dbdf3b
Delete modified_proteins_summ.cpython-37.pyc
chinmayaNK22 Jul 10, 2021
a7d8173
Update modified_proteins_summ.py
chinmayaNK22 Nov 9, 2022
e65d71b
Update PTM_summarizer.py
chinmayaNK22 Nov 9, 2022
3e83196
Create read_fasta_file_v2.py
chinmayaNK22 Nov 9, 2022
16fdc2e
Update modified_proteins_summ.py
chinmayaNK22 Nov 9, 2022
84a3025
Update PTM_summarizer.py
chinmayaNK22 Nov 9, 2022
7df5134
Merge branch 'PTM-Summarizer_V1' of https://github.com/chinmayaNK22/P…
chinmayaNK22 Nov 9, 2022
5b80f51
Update PTM_summarizer.py
chinmayaNK22 Nov 9, 2022
5b4f836
Update PTM_summarizer.py
chinmayaNK22 Nov 9, 2022
7b0aac7
Update PTM_summarizer.py
chinmayaNK22 Nov 9, 2022
1e2450d
Update PTM_summarizer.py
chinmayaNK22 Nov 9, 2022
fba8ee7
Update PTM_summarizer.py
chinmayaNK22 May 12, 2023
f5a2a56
Update modified_proteins_summ.py
chinmayaNK22 May 12, 2023
a781509
Create plots.py
chinmayaNK22 May 12, 2023
bbf3adc
Update PTM_summarizer.py
chinmayaNK22 Aug 25, 2023
b49886a
Update PTM_summarizer.py
chinmayaNK22 Dec 26, 2023
036e3d6
Update PTM_summarizer.py
chinmayaNK22 May 18, 2024
b550f08
Update PTM_summarizer.py
chinmayaNK22 May 18, 2024
d631fa6
Update PTM_summarizer.py
chinmayaNK22 May 20, 2024
3f3b3f5
Update PTM_summarizer.py
chinmayaNK22 Nov 11, 2024
a24e0af
Update README.md
chinmayaNK22 Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222,904 changes: 222,904 additions & 0 deletions HumanRefSeq_GCF_000001405.39_GRCh38.p13_protein_refseq109_formated.fasta

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Chinmaya Narayana

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
62 changes: 0 additions & 62 deletions Modified_Proteins_new_063021.py

This file was deleted.

287 changes: 147 additions & 140 deletions PTM_ProAdvanced.pl → PTM_summarizer.pl
Original file line number Diff line number Diff line change
@@ -1,140 +1,147 @@
#!/usr/bin/perl

use strict;
use warnings;

my $ref_fasta="HumanRefSeq_GCF_000001405.39_GRCh38.p13_protein_refseq109_formated.fasta";
my $infile="SARS_CoV2_Mulit-PTM_PSMs_PTMs.txt";

my %hash=();
my %hashCount=();
my %hashLine=();
my %hash4upset=();
my %hashUniqPro=();
my @allM="";
#my @allM_Pro="";

my $ref_id="";
my %ref_Seq=();
open(REF,"$ref_fasta") or die "Could not open the file:$!\n";
while(<REF>)
{
chomp;
$_=~s/\r//g;
if(/^>/)
{
$ref_id = (split /\|/)[1]; ## Header Parse for Master protein accession
$ref_id =~s/\>//;
}
else
{
$ref_Seq{$ref_id}.="$_";
}
}
close REF;

open(IN,"$infile") or die "Could not open the file:$!\n";
while(<IN>)
{
chomp;
$_=~s/\r//g;
$_=~s/\"//g;
unless(/^Annotated/)
{
my $line=$_;
my ($Seq,$mas,$status,$fs,$ptmRS)=(split /\t/)[3,7,15,26,-1];#Sequence, Master Protein, mz, First scan, ptmRS
#if(10==10)#if($status eq "Selected")
{
$mas=~s/\;\s/\;/g;
my $annSeq=(split /\./,$Seq)[1];
$ptmRS=~s/\s//g;
my @allMod=(split /\;/,$ptmRS);
foreach my $i (@allMod)
{
if($i=~/([A-Z])([0-9]*?)\((.*?)\)\:([0-9]*)/)
{
my ($aa,$pos,$ty,$rs)=($1,$2,$3,$4);
if($rs >= 75)
{
my $k=$annSeq."_".$mas."_".$aa.$pos;
unless(($ty eq "Oxidation") || (($ty eq "Deamidated") && (($aa eq "N")||($aa eq "Q"))))
{
foreach my $m (split /\;/,$mas)
{
#print "$m\n";
my $Proseq = $ref_Seq{$m};
my $ann = $annSeq; $ann=~tr/[a-z]/[A-Z]/;
my $index = (index ($Proseq, $ann) + $pos);
#print OUT "$annSeq\t$mas\t$m\t$ty\t$aa\t$index\n";
my $uniqPro=$m."_".$ty."_".$aa."_".$index;
$hashUniqPro{$uniqPro}="$annSeq\t$m\t$ty\t$aa\t$index";
#push(@allM_Pro,$ty);
}
unless(exists $hash{$k}{$ty})
{
$hash{$k}{$ty}="";
$hashCount{$ty}{$aa}++;
$hashLine{$ty}{$aa}.="$_\n";
my $mod=$ty."_".$aa;
my $ty2=$ty;$ty2=~s/\+HeavyK//g;
$hash4upset{$annSeq}{$ty2}.="";
push(@allM,$ty2);
}
}
}
}
}
}
}
}
close IN;

open(OUTUNIQPRO,">UniqueProteinSite.txt") or die "Could not create the file:$!\n";
foreach my $k1 (keys %hashUniqPro)
{
print OUTUNIQPRO "$hashUniqPro{$k1}\n";
}
close OUTUNIQPRO;

open(OUT1,">summary.txt") or die "Could not create the file:$!\n";
foreach my $k1 (keys %hashCount)
{
print OUT1 "$k1\n";
foreach my $k2 (keys %{$hashCount{$k1}})
{
print OUT1 "$k1\t$k2\t$hashCount{$k1}{$k2}\n";
my $file=$k1."_".$k2.".txt";
open(OUT,">$file") or die "Could not create the file:$!\n";
print OUT "$hashLine{$k1}{$k2}\n";
close OUT;
}
#print OUT1 "\n";
}
close OUT1;

my @unique = do { my %seen; grep { !$seen{$_}++ } @allM };
open(OUT2,">ForUpset3.txt") or die "Could not create the file:$!\n";
print OUT2 "Peptide";
foreach (@unique)
{
print OUT2 "\t$_";
}
print OUT2 "\n";
foreach my $k1 (keys %hash4upset)
{
print OUT2 "$k1";
foreach my $k2 (@unique)
{
if((exists $hash4upset{$k1}) && (exists $hash4upset{$k1}{$k2}))
{
print OUT2 "\t1";
}
else
{
print OUT2 "\t0";
}
}
print OUT2 "\n";
}
close OUT2;
exit;
#!/usr/bin/perl

#################### Usage ###########################
###### perl PTM_summarizer.pl ref.fasta PSM.txt ######
######################################################

use strict;
use warnings;

my $ref_fasta=$ARGV[0];
my $infile=$ARGV[1];

my %hash=();
my %hashCount=();
my %hashLine=();
my %hash4upset=();
my %hashUniqPro=();
my @allM="";
#my @allM_Pro="";

my $ref_id="";
my %ref_Seq=();
open(REF,"$ref_fasta") or die "Could not open the file:$!\n";
while(<REF>)
{
chomp;
$_=~s/\r//g;
if(/^>/)
{
$ref_id = (split /\|/)[1]; ## Header Parse for Master protein accession
$ref_id =~s/\>//;
}
else
{
$ref_Seq{$ref_id}.="$_";
}
}
close REF;

open(IN,"$infile") or die "Could not open the file:$!\n";
while(<IN>)
{
chomp;
$_=~s/\r//g;
$_=~s/\"//g;
unless(/^Annotated/)
{
my $line=$_;
my ($Seq,$mas,$status,$fs,$ptmRS)=(split /\t/)[3,7,15,26,-1];#Sequence, Master Protein, mz, First scan, ptmRS
#if(10==10)#if($status eq "Selected")
{
$mas=~s/\;\s/\;/g;
my $annSeq=(split /\./,$Seq)[1];
$ptmRS=~s/\s//g;
my @allMod=(split /\;/,$ptmRS);
foreach my $i (@allMod)
{
if($i=~/([A-Z])([0-9]*?)\((.*?)\)\:([0-9]*)/)
{
my ($aa,$pos,$ty,$rs)=($1,$2,$3,$4);
if($rs >= 75)
{
my $k=$annSeq."_".$mas."_".$aa.$pos;
unless(($ty eq "Oxidation") || (($ty eq "Deamidated") && (($aa eq "N")||($aa eq "Q"))))
{
foreach my $m (split /\;/,$mas)
{
#print "$m\n";
my $Proseq = $ref_Seq{$m};
my $ann = $annSeq; $ann=~tr/[a-z]/[A-Z]/;
my $index = (index ($Proseq, $ann) + $pos);
#print OUT "$annSeq\t$mas\t$m\t$ty\t$aa\t$index\n";
my $uniqPro=$m."_".$ty."_".$aa."_".$index;
my $ty_aa = $ty."_".$aa;
$hashUniqPro{$uniqPro}="$annSeq\t$m\t$ty\t$aa\t$ty_aa\t$index";
#push(@allM_Pro,$ty);
}
unless(exists $hash{$k}{$ty})
{
$hash{$k}{$ty}="";
$hashCount{$ty}{$aa}++;
$hashLine{$ty}{$aa}.="$_\n";
my $mod=$ty."_".$aa;
my $ty2=$ty;$ty2=~s/\+HeavyK//g;
$hash4upset{$annSeq}{$ty2}.="";
push(@allM,$ty2);
}
}
}
}
}
}
}
}
close IN;

my $outun = $infile; $outun =~s/\.txt$/\_UniqueProteinSite.txt/;
open(OUTUNIQPRO,">$outun") or die "Could not create the file:$!\n";
foreach my $k1 (keys %hashUniqPro)
{
print OUTUNIQPRO "$hashUniqPro{$k1}\n";
}
close OUTUNIQPRO;

my $out1 = $infile; $out1 =~s/\.txt$/\_summary.txt/;
open(OUT1,">$out1") or die "Could not create the file:$!\n";
foreach my $k1 (keys %hashCount)
{
print OUT1 "$k1\n";
foreach my $k2 (keys %{$hashCount{$k1}})
{
print OUT1 "$k1\t$k2\t$hashCount{$k1}{$k2}\n";
my $file=$k1."_".$k2.".txt";
open(OUT,">$file") or die "Could not create the file:$!\n";
print OUT "$hashLine{$k1}{$k2}\n";
close OUT;
}
#print OUT1 "\n";
}
close OUT1;

my @unique = do { my %seen; grep { !$seen{$_}++ } @allM };
open(OUT2,">ForUpset.txt") or die "Could not create the file:$!\n";
print OUT2 "Peptide";
foreach (@unique)
{
print OUT2 "\t$_";
}
print OUT2 "\n";
foreach my $k1 (keys %hash4upset)
{
print OUT2 "$k1";
foreach my $k2 (@unique)
{
if((exists $hash4upset{$k1}) && (exists $hash4upset{$k1}{$k2}))
{
print OUT2 "\t1";
}
else
{
print OUT2 "\t0";
}
}
print OUT2 "\n";
}
close OUT2;
exit;
Loading