SEQanswers

SEQanswers (http://seqanswers.com/forums/index.php)
-   Bioinformatics (http://seqanswers.com/forums/forumdisplay.php?f=18)
-   -   How can I extract each APAsite possibility from this table? (http://seqanswers.com/forums/showthread.php?t=96747)

gcR 11-11-2020 08:37 AM

How can I extract each APAsite possibility from this table?
 
Hello,

I have an output from APATrap package, which gives back the predicted APA sites from samples. I need to make a list from all the possibles APAs to cross it with miRNAs database and get known if there is a match. The problem is a have a huges lists from 16 samples, and I need a way to automatize this task for reproducibility.

I have this summed up table:

Predicted_APA.TOTAL Loci.TOTAL

41867799,41867388,41866990 chr17:41866927-41867904

And I need something like this:

CHR Loci.UTR.TOTAL Locus initial Locus Final

chr17 41866927-41867799 41866927 41867799
chr17 41866927-41867388 41866927 41867388
chr17 41866927-41866990 41866927 41866990

Do you know any tip or clue to do it for 16 samples with 1000 results each one?

Thanks in advance, and sorry if my question isn't appropriate. I will answer any question for further people in the same situation.

gcR 11-30-2020 05:59 AM

I got this answer from another forum, so I add it here in case someone needs it.

input:
Quote:

$cat test.txt

Predicted_APA.TOTAL Loci.TOTAL
41867799,41867388,41866990 chr17:41866927-41867904
output:
Quote:

$awk -v FS='[-:\t]' -v OFS="\t" ' NR != 1 {split($1,a,","); for (i in a) {print $2,$3"-"a[i],$3,a[i]}}' test.txt

chr17 41866927-41867799 41866927 41867799
chr17 41866927-41867388 41866927 41867388
chr17 41866927-41866990 41866927 41866990


All times are GMT -8. The time now is 09:15 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.