INSTRUCTION
stringlengths 48
14.1k
| RESPONSE
stringlengths 14
8.79k
| SOURCE
stringclasses 1
value | METADATA
stringlengths 48
55
|
|---|---|---|---|
Hello biostars,
I am new to this type of analysis. I have IDR.NarrowPeak data and I would like to normalise it to FPKM using R.
I read that the packages limma and DESeq are helpful but I still have problems creating the count matrix.
Is there a step I am missing?
Any help/suggestion will be appreciated.
|
You should try DiffBind, which uses DESeq and edgeR in the background and automates this process: https://bioconductor.org/packages/release/bioc/html/DiffBind.html
|
biostars
|
{"uid": 272864, "view_count": 1700, "vote_count": 2}
|
<p>hi there,
is there a way to get count of SNP, indels, CNVs etc from a VCF file, so some thing like</p>
<p>SNPs = ?</p>
<p>Insertions = ?</p>
<p>Deletions = ?</p>
<p>CNVs = ?</p>
<p>using simple linux commands</p>
<p>thanks,
a</p>
|
There are a couple of ways that variant type is annotated within a VCF file, so there are correspondingly a few ways to get close to what you want. Here's one choice that should work with most VCF files:
Use the `vcftools` tool `vcf-annotate` to fill in the variant type field:
zcat in.vcf.gz | vcftools_0.1.9/bin/vcf-annotate --fill-type > out.vcf
Then count up the variants by looking at the (newly-filled) TYPE field:
grep -oP "TYPE=\w+" out.vcf | sort | uniq -c
Or in one step that doesn't change the original VCF file:
zcat in.vcf.gz | vcftools_0.1.9/bin/vcf-annotate --fill-type | grep -oP "TYPE=\w+" | sort | uniq -c
On an example I had, this yielded:
3410 TYPE=del
4487 TYPE=ins
56744 TYPE=snp
1000 Genomes VCF files will be annotated in a finer-grained way (e.g. choices including DUP, INV, CNV, TANDEM, see [here](http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41)), but I'm not sure how to get their range of annotations from your own raw read data. However, if these distinctions are critical to you, that may be a useful direction to explore.
|
biostars
|
{"uid": 50923, "view_count": 24648, "vote_count": 5}
|
Dear All,
I have found a total list of about 3000 transcripts that I am interested in their gene ontology functions. I have the .fasta file of each transcripts. Can anyone advise on how should I go about to extract the GO symbols for each genes?
The pipeline I can think of is input the .fasta file onto GUI-version of Blast2Go and run a remote blast, and then map the GO from Blast2Go. I am already running this right now but it seems quite slow.
Any alternative strategies here?
regards
Ziyi
|
<p>Blast2GO is impractially slow in my experience and doesn't fit well into a Unix pipeline, though that is not the usual target usage. Another approach is <a href="https://github.com/sestaton/HMMER2GO">HMMER2GO</a> if you don't find a few commands. Here is an example starting with some transcript assemblies called "genes.fasta" and ending with GO terms for each gene/contig.</p>
<pre>
hmmer2go getorf -i genes.fasta -o genes_orfs.faa
hmmer2go run -i genes_orfs.faa -d Pfam-A.hmm
hmmer2go mapterms -i genes_orfs_Pfam-A.tblout -o genes_orfs_Pfam-A_GO.tsv --map</pre>
<p>There is some documenation on the <a href="https://github.com/sestaton/HMMER2GO/wiki/Tutorial">wiki</a> or at the command line and a full <a href="https://github.com/sestaton/HMMER2GO/wiki/Demonstraton">example</a>, as well.</p>
|
biostars
|
{"uid": 163980, "view_count": 7424, "vote_count": 4}
|
Hi all,
I’ve been working on RNA-seq data for a while, in the context of (yet another) differential expression app, and wanted to try to new ways of representing data. Upset plots appeared interesting, especially given the prevalence of Venn Diagrams to compare sets of genes in the case of multiple contrasts such as **treatment A vs control** and **treatment B versus control**. They can visually answer questions of how many genes are differentially expressed across those two contrasts? How many are exclusive to this one?
I initially wanted to represent differentially expressed genes (DEGs) in common between contrasts, then it hit me that there are two types of DEGs in common between treatment A and B : the ones that are differentially expressed in the same direction, and the others. If Gene 34 is overexpressed in **treatment A vs control**, and underexpressed **treatment B versus control**, is there a biological point to place it in the same group as Gene 56 that is overexpressed in both? Outside of the plot itself, I wanted the different intersections to be downloadable, to be used in functional enrichment tools down the line.
To me, this is somewhat adjacent (but not identical) to the question of signed and unsigned networks in the case of WGCNA, as to whether it makes sense to distinguish between negative correlation or positive correlation between two genes (signed), or not (unsigned), when *translating* correlation to ridge weight. In this case, I think the authors favored signed networks, which in our case would be akin to distinguishing between over and underexpressed?
The issue is that, if one favors DEGs that are expressed in the same direction across two contrasts, then most upset plots packages (I use R) I’ve seen, that rely on a boolean matrix data that looks like this :
```
| | treatmentA_vs_Control | TreatmentB_vs_Control | TreatmentC_vs_Control |
|-------|-----------------------|-----------------------|-----------------------|
| Gene1 | TRUE | FALSE | TRUE |
| Gene2 | FALSE | FALSE | TRUE |
| Gene3 | FALSE | TRUE | TRUE |
```
where **TRUE** indicates that a gene is differentially expressed in a contrast, cannot be used.
One cannot specify *a priori* if a DEG is indeed DE in the same direction in two contrasts, before comparing two sets.
|
It depends how you want to handle this. When I compare several quite different differential expression sets (multiple diseases, or multiple treatments), I will split the UpSet plots into "upregulated" and "downregulated" genes. If I'm comparing multiple sub-populations of the same study, or studies with substantially similar designs, I will use a standard UpSet plot, and enforce both significance and sign -- with the sign chosen by majority vote among significant genes (`+ - +` --> `T F T`; `- - +` -> `T T F`).
Finally there are cases where 'discordant' differential expression is of interest (such as comparing peak activity and gene expression); in such cases I will go as far as to split the differential expression gene sets by the nominal direction, so instead of `set1, set2, set3` I have `set1.up set1.down set2.up set2.down set3.up set3.down`; color-code the sets by the direction. UpSet plots are still a key visual representation in this instance.
|
biostars
|
{"uid": 9534112, "view_count": 611, "vote_count": 2}
|
I'm working from the Biostar Handbook and trying to do the alignment with tophat. I'm on page 480 for reference.
I was able to successfully run
$ bowtie2-build $REF $IDX
However, then it says that I need to change the invocation of the aligner to
$ tophat -G $GTF -o tophat_hbr1 $IDX $R1 $R2
bash: /usr/bin/tophat: No such file or directory
(bioinfo)
And that's my output. If I do which tophat, nothing comes up, so it seems like it's just not there. So, I tried to install tophat with
$ conda install tophat
Fetching package metadata .................
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- python 3.6*
- tophat -> python 2.7*
Use "conda info <package>" to see the dependencies for each package.
(bioinfo)
I saw some solutions online for changing a line of code in tophat to do this, but I don't even know where that file is. I can downgrade python, but I'm not sure if that will work, and I'm worried that I'll break other things if I do. Also, when I do
$ ls /usr/bin | grep python
dh_python2
dh_python3
python
python-config
python2
python2-config
python2.7
python2.7-config
python3
python3.4
python3.4m
python3m
x86_64-linux-gnu-python-config
x86_64-linux-gnu-python2.7-config
(bioinfo)
moltres@moltres-ao ~/biostar/Sequencing/griffith
$ python -V
Python 3.6.3
(bioinfo)
I see a bunch of different python versions, and I'm not sure if I should switch between them or what.
I'm a little frustrated because I bought this book because I'm a beginner, but I keep running into errors that are over my head. I'd really appreciate help here.
|
[Create a new environment for Tophat][1]:
conda create -n tophat2 tophat2
should create a new environment and install Tophat2 and its correct dependencies.
[1]: https://conda.io/docs/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands
|
biostars
|
{"uid": 306829, "view_count": 1659, "vote_count": 1}
|
Hello,
I'm new here and and I need help please!
I need to download a list of all human genes with their respective gene symbol | chromosome | strand | transcription start site | Txen | and **Ensembl gene name**,
Actually I'm using UCSC table and I get something like this:
```
#hg38.knownGene.name hg38.knownGene.chrom hg38.knownGene.strand hg38.knownGene.txStart hg38.knownGene.txEnd hg38.kgXref.geneSymbol
uc001aaa.3 chr1 + 11873 14409 DDX11L1
```
And I want to know if it's possible to include ensembl gene symbol with UCSC table or with another method
Thank you in advance
Cherif
|
Unfortunately UCSC table browser doesn't have Ensembl gene track for hg38. But they do have it for hg19 and the below command should work for you.
```
mysql \
--user=genome \
-N \
--host=genome-mysql.cse.ucsc.edu \
-A \
-D hg19 \
-e "select ensGene.name, name2, chrom, strand, txStart, txEnd, value from ensGene, ensemblToGeneName where ensGene.name = ensemblToGeneName.name" > \
output.txt
```
You can try the same command with hg38 but you will have to choose other gene models such as refseq or ucsc.
|
biostars
|
{"uid": 110797, "view_count": 11297, "vote_count": 1}
|
Hi all, I have several millions of records with format `chromosome position` like:
```
chr1 10001
chr1 144244
chr2 ...
```
And I know it is from human hg19. Now I want to get the ATGC info for each position so it would become:
```
chr1 10001 A
chr1 144244 G
chr2 ...
```
Anyone know what is the best practice for such job. Tools like UCSC table work for single record, but too slow for a lot of them.
|
`bedtools getfasta` will also work for this job. You should create a bed file with the chromosome start and end positions that you'd like to extract:
chr1 10001 10002
chr1 144244 144245
...
|
biostars
|
{"uid": 169469, "view_count": 6669, "vote_count": 1}
|
I'm wondering if there's a way we can recover the mean gene expression
used for calculating the fold change of [scran::pairwiseTTests][1].
I tried the following code used for calculating fold change using `scran::pairwiseTTests`:
```
library(scuttle)
library(scran)
library(tidyverse)
sce <- mockSCE()
sce <- logNormCounts(sce)
cell_groupings <- colData(sce)$Mutation_Status
names(cell_groupings) <- rownames(sce)
out <- pairwiseTTests(scuttle::logNormCounts(sce), groups=cell_groupings)
out$statistics[[1]] %>% # negative / positive
as.data.frame() %>%
rownames_to_column(var = "genes") %>%
as_tibble() %>%
arrange(desc(logFC))
```
It produces
```
genes logFC p.value FDR
<chr> <dbl> <dbl> <dbl>
1 Gene_1740 1.20 0.000617 0.733
2 Gene_0691 0.968 0.00435 0.733
3 Gene_1755 0.932 0.00690 0.733
4 Gene_1460 0.916 0.0107 0.733
5 Gene_0894 0.890 0.0129 0.733
6 Gene_1910 0.847 0.0208 0.761
7 Gene_1839 0.844 0.0168 0.733
8 Gene_1147 0.839 0.00304 0.733
9 Gene_0477 0.832 0.0134 0.733
10 Gene_1201 0.816 0.00643 0.733
```
Notice that the logFC for Gene_1740 is 1.20 and Gene_0691 is 0.968.
But when I compute manually to get mean expression:
```
meta_data_df <- colData(sce) %>%
as.matrix() %>%
as.data.frame() %>%
rownames_to_column(var = "barcodes") %>%
as_tibble()
scuttle::normalizeCounts(sce) %>%
as.matrix() %>%
as.data.frame() %>%
rownames_to_column(var = "genes") %>%
as_tibble() %>%
pivot_longer(-genes, names_to = "barcodes", values_to = "gexp") %>%
left_join(meta_data_df, by = "barcodes") %>%
filter(genes %in% c("Gene_1740", "Gene_0691")) %>%
group_by(genes, Mutation_Status) %>%
summarise(mean_gexp = mean(gexp)) %>%
pivot_wider(names_from = "Mutation_Status", values_from = "mean_gexp") %>%
mutate(logFC = log2(negative/positive)) %>%
arrange(desc(logFC))
```
I get
```
genes negative positive logFC
<chr> <dbl> <dbl> <dbl>
1 Gene_1740 4.74 3.54 0.421
2 Gene_0691 4.28 3.32 0.370
```
Notice the difference in logFC. Is there a way I can easily recover the actual expression so that the logFC match
calculated with `scran::pairwiseTTests`?
[1]: https://rdrr.io/bioc/scran/man/pairwiseTTests.html
|
Isn't the logFC just `logcounts(group1)-logcounts(group2)`? You seem to be using the normalized counts but not on logscale.
I just copied 99% of your code but made a change in the last chunk, using the logcounts:
library(scuttle)
library(scran)
library(tidyverse)
set.seed(1)
sce <- mockSCE()
sce <- logNormCounts(sce)
cell_groupings <- colData(sce)$Mutation_Status
names(cell_groupings) <- rownames(sce)
out <- pairwiseTTests(scuttle::logNormCounts(sce), groups=cell_groupings)
ttest <-
out$statistics[[1]] %>% # negative / positive
as.data.frame() %>%
rownames_to_column(var = "genes") %>%
as_tibble() %>%
arrange(desc(logFC)) %>%
filter(genes %in% c("Gene_0691", "Gene_1740"))
meta_data_df <- colData(sce) %>%
as.matrix() %>%
as.data.frame() %>%
rownames_to_column(var = "barcodes") %>%
as_tibble()
manually <-
logcounts(scuttle::logNormCounts(sce)) %>% # <=== HERE IS THE CHANGE
as.matrix() %>%
as.data.frame() %>%
rownames_to_column(var = "genes") %>%
as_tibble() %>%
pivot_longer(-genes, names_to = "barcodes", values_to = "gexp") %>%
left_join(meta_data_df, by = "barcodes") %>%
filter(genes %in% c("Gene_1740", "Gene_0691")) %>%
group_by(genes, Mutation_Status) %>%
summarise(mean_gexp = mean(gexp)) %>%
pivot_wider(names_from = "Mutation_Status", values_from = "mean_gexp") %>%
mutate(logFC = negative-positive) %>% # <=== HERE IS THE CHANGE
arrange(desc(logFC))
data.frame(ttest=ttest$logFC, manually=manually$logFC)
ttest manually
1 0.3583096 0.3583096
2 -0.2008851 -0.2008851
Now it's the same.
|
biostars
|
{"uid": 9513819, "view_count": 451, "vote_count": 1}
|
There are so many things to read about ga4gh: I'm a little bit lost. So here are a few questions about [GA4GH][1] / Beacons :
- I've got some VCF files. What is the correct way to expose my data? How can I secure my data for my collaborators? Is there a java server implementation?
- If I build a beacon server from scratch (learning... learning...) is there a tool that can be used to test if my implementation is [ga4gh][1] compliant?
- Where should I declare that I'm providing a beacon server?
- The schema use [avro][2]; Is it possible to return plain JSON or does using Avro means that I need to serialize the data as a binary stream? Is there any API converting jaav+htsjdk to avro?
- What's the best place to ask questions about ga4gh?
[1]: http://genomicsandhealth.org/
[2]: https://avro.apache.org/
|
<p>This should be the easiest beacon server to run (disclosure: I'm the developer): https://github.com/maximilianh/ucscBeacon</p>
<p>Should run on any OS, brings its own webserver or runs as a CGI. Can import directly: VCF, Complete Genomics, BED, HGMD and LOVD formats. A single python script, no dependencies. Let me know if something doesn't work for you.</p>
|
biostars
|
{"uid": 163573, "view_count": 1755, "vote_count": 4}
|
Hi,
I have to plot allele frequencies of two different SNP chip datasets. I have two VCF files and would like to make a scatterplot in which these 2 datasets are plotted one against each other. What is the easiest way to do this?
I apologize if this question was already posted.
|
bcftools query -i 'N_ALT=1' -f '%CHROM\_%POS\_%REF\_%ALT\t%INFO/AF\n' in1.vcf.gz | sort -t $'\t' -k1,1 > a.tsv
bcftools query -i 'N_ALT=1' -f '%CHROM\_%POS\_%REF\_%ALT\t%INFO/AF\n' in2.vcf.gz | sort -t $'\t' -k1,1 > b.tsv
join -a 1 -a 2 -o '1.2,2.2' -t $'\t' -1 1 -2 1 -e 0.0 a.tsv b.tsv > compare.tsv
plot with R : https://stackoverflow.com/questions/42232340/how-to-read-tab-separated-files-in-r-to-generate-scatterplot
|
biostars
|
{"uid": 9496481, "view_count": 1107, "vote_count": 1}
|
I'm a Computer Science undergraduate writing my thesis which is about analyzing open source bioinformatics projects and extracting standalone modules. I need those projects to be written in Java and preferably be stable or mature. So far I've found a bunch of projects via SourceForge and I was wondering if there are any notable ones that are not hosted there. A different repository that has a bioinformatics category would be helpful too.
Here's a list of the most promising projects I have so far:
- Jenetics
- JGap
- Jmol
- Juicebox
- Picard
- RDP Classifier
- Shim
- Tassel
- The Chemistry Development Kit
- Toxfree
- TreeView
- VarScan
Thanks in advance.
|
- [Archaeopteryx][1]
- [Cytoscape][2]
[1]: https://sites.google.com/site/cmzmasek/home/software/archaeopteryx
[2]: http://www.cytoscape.org/
|
biostars
|
{"uid": 178093, "view_count": 2145, "vote_count": 2}
|
In polyploid genomes with limited variation between subgenomes generally read mapping is a challenge leading to frequent read mismapping and hence calling homeologous variants, eg variations that are actually differences between the subgenomes.
When using discoSnp, you can imagine that these loci could also collapse and variants would appear heterozygous among all samples if the locus is non-branching. One could then use read frequency to decide if the variant is homeologous. One would expect to observe a 50/50 distribution of the two alleles in case of a tetraploid or a 25/75 distribution in case of a true variant as the non variant locus would contribute relatively more to the stack.
However when branching becomes more complex such an approach may become difficult and such variants might still end up in the same locus while actually originating from different loci. Are there any strategies that could be applied to recognize these cases and discern between the different loci?
Related to this, when does discoSnp decide that a graph becomes too complex and decides to split it into separate graphs.
Thanks for the reply.
|
Hello Yahan,
Thanks for your question here.
Generally speaking, discoSnp confuses true variants with inter-repetition or inter-genome variations.
There are then several ways of sorting out the true and false positives calls.
- One expects that true variants discriminate individuals and thus discriminate read sets. This is why we proposed the *rank* value, associated with each variant. In our experiments, we have shown that variants with rank < 0.2 are likely false positives, while most (>95%) other ones are true positives (see fig7 of the [paper][1]).
- If variants are mapped on a reference genome (for instance using the VCFcreator tool integrated to disco), uniquely mapped variants are likely to be true positives (marked as *PASS*) while other ones (marked as *MULTIPLE*) are more likely due to inter-repetition or inter-genome variations.
Hoping this helps,
Pierre
[1]: https://www.ncbi.nlm.nih.gov/pubmed/25404127
|
biostars
|
{"uid": 300726, "view_count": 1020, "vote_count": 1}
|
File1
#CHROM POS ID REF_Zv ALT_lm
chr1A 219620 . T A
chr1A 219648 . A G
chr1A 219867 . A G
file2
#CHROM POS ID REF_Zv ALT_RV
chr1A 219457 . C T
chr1A 219670 . A G
chr1A 219867 . A C
File3
#CHROM POS ID REF_Zv ALT_lm ALT_RV
chr1A 219620 . T A NA
chr1A 219648 . A G NA
chr1A 219867 . A G C
chr1A 219457 . C NA T
chr1A 219670 . A NA C
My command is
awk 'FNR==NR{a[$1,$2];next} {if(a[$1,$2]==""){a[$1,$2]=0};print $1,$2,$3,$4,$5, a[$4,$5]} ' file1 file2 > file3
However,
I can not get the file3 which I want.
Could you help me improve the command?
Thanks,
Fuyou
|
Using **R** *merge*:
# example files
file1 <- read.table(text = "#CHROM POS ID REF_Zv ALT_lm
chr1A 219620 . T A
chr1A 219648 . A G
chr1A 219867 . A G", header = TRUE, stringsAsFactors = FALSE,
comment.char = "")
file2 <- read.table(text = "#CHROM POS ID REF_Zv ALT_RV
chr1A 219457 . C T
chr1A 219670 . A G
chr1A 219867 . A C", header = TRUE, stringsAsFactors = FALSE,
comment.char = "")
merge(file1, file2, by.x = c("X.CHROM", "POS", "ID", "REF_Zv"), all = TRUE)
# X.CHROM POS ID REF_Zv ALT_lm ALT_RV
# 1 chr1A 219457 . C <NA> T
# 2 chr1A 219620 . T A <NA>
# 3 chr1A 219648 . A G <NA>
# 4 chr1A 219670 . A <NA> G
# 5 chr1A 219867 . A G C
|
biostars
|
{"uid": 341329, "view_count": 1872, "vote_count": 1}
|
Hi,
From where to download the fully sequenced chloroplast genome of rice (oryza sativa japonica)?
Genome sequence fasta file form ensemble plant and ncbi has only 12 chromosomes with no chloroplast DNA?
Thanks,
Waqas.
|
Via http://chloroplast.cbio.psu.edu/ --
http://www.ncbi.nlm.nih.gov/nuccore/NC_001320.1?report=Genbank
|
biostars
|
{"uid": 180049, "view_count": 2736, "vote_count": 1}
|
![enter image description here][1]
[1]: https://img.techpowerup.org/190813/screenshot-23.png
Hi,
I am doing reciprocal blast to find ortholog. for that i run i create database and run blastn and retrieve hit sequence fasta through awk 'BEGIN { OFS = "\n" } { print ">"$2, $3 }' blast.out > hit.fa
but when i am trying to align hit.fa to reference genome database, i am getting this issue.
I used this command.--
blastn -query ~/Blast/hit.fa -db ~/Blast/omykiss/genome/omykiss -outfmt 6 -out blast_out -num_alignments 1
please help to solve it.
Thanks in advance
|
Hyphens (coding for indels relative to another sequence, from BLAST in this case) are not in {A, C, G, T, N}. You should remove them or replace them with Ns, depending on what you're trying to do.
A [quick Google search][1] reveals this was an issue in some other applications, as well.
[1]: https://github.com/wwood/singlem/issues/17
|
biostars
|
{"uid": 394195, "view_count": 3088, "vote_count": 2}
|
<p>I'm trying to find all the reads (by name) from a BAM file that align to various regions in a bed file. Right now I can do this with <code>bedtools</code> using <code>intersectBed</code>:</p>
<pre><code>intersectBed -abam reads.bam -wo -f 1 -b regions.bed -bed
</code></pre>
<p>From this one can parse all the read ids that land in every interval in <code>regions.bed</code>, but it's not very compact. Is there a way to get <code>bedtools</code> to natively transform this into a more compact format, e.g.</p>
<pre><code>chr1 x y .... read_id1,read_id2,read_id3
</code></pre>
<p>where <code>chr1 x y</code> is a given interval in <code>regions.bed</code> and the comma separated <code>read_id1,...</code> is the list of read ids from <code>reads.bam</code> that fall in that interval. In this compact format, the output BED file would have at most as many entries as there are regions in <code>regions.bed</code>, whereas with the <code>-wo</code> option it can be even larger than the number of reads in <code>reads.bam</code>. Thanks.</p>
|
One way to do this is to turn things around a bit, by making your BAM file be the "B" input. This way, the "driving" "A" file will be your regions.bed. This example below requires that your BAM file is sorted by position. Now, intersect won't allow BAM as the B file directly (it will soon), but you can use `bedtobam` to convert it to BED and pipe this to `intersect`. Using the -sorted option to limit memory consumption (and requiring that both the BED and the BAM are position sorted; `sort -k1,1 -k2,2n` for your BED file), you can pipe the output to the `groupby` option to get the result you'd like. The `collapse` option in groupby takes all values from a specific column (in this case the read ID is the 8th column) and creates a comma separated list from them. The list is returned based on changes in the columns upon which you are grouping --- in this case, columns 1-4 (`-g 1-4`), which represent the columns in my example regions file. Below is an example with some test files I have. If you are unfamiliar with `groupby`, there are more details <a href="http://bedtools.readthedocs.org/en/latest/content/tools/groupby.html">here</a>.
$ bedtools bamtobed -i testingData/NA18152.bam | head -3
chr1 554304 554637 NA18152-SRR007381.35051 16 -
chr1 554304 554618 NA18152-SRR007381.637219 16 -
chr1 554304 554656 NA18152-SRR007381.730912 16 -
...
Intersect the regions with the BAM file (NOTE: I have annotated the output to show where each output group starts). In this example, the BAM read name is the 8th column and the overlap (`-wo`) is the 11th column.
$ bedtools bamtobed -i NA18152.sorted.bam | \
bedtools intersect -a regions.bed -b - -sorted -wo
# group 1
chr1 713984 714547 CpG:_60 chr1 714220 714373 NA18152-SRR007381.251923 31 + 153
chr1 713984 714547 CpG:_60 chr1 714220 714368 NA18152-SRR007381.831825 37 + 148
# group 2
chr1 858970 861632 CpG:_257 chr1 860064 860310 NA18152-SRR007381.329161 10 - 246
# group 3
chr1 875730 878363 CpG:_246 chr1 875876 876203 NA18152-SRR007381.732122 9 + 327
# group 4
chr1 933387 937410 CpG:_413 chr1 936966 937135 NA18152-SRR007381.925947 12 - 169
# group 5
chr1 1109314 1110145 CpG:_59 chr1 1108986 1109385 NA18152-SRR007381.659411 23 + 71
chr1 1109314 1110145 CpG:_59 chr1 1108992 1109433 NA18152-SRR007381.615088 38 + 119
chr1 1109314 1110145 CpG:_59 chr1 1108992 1109347 NA18152-SRR007381.677905 43 + 33
chr1 1109314 1110145 CpG:_59 chr1 1109029 1109424 NA18152-SRR007381.217465 44 - 110
chr1 1109314 1110145 CpG:_59 chr1 1109038 1109346 NA18152-SRR007381.1495841 46 + 32
...
Now use group by to condense the read names and overlap columns
$ bedtools bamtobed -i NA18152.sorted.bam | \
bedtools intersect -a regions.bed -b - -sorted | \
bedtools groupby -g 1-4 -c 8,11 -o collapse,collapse \
head -5
chr1 713984 714547 CpG:_60 NA18152-SRR007381.251923,NA18152-SRR007381.831825 153,148
chr1 858970 861632 CpG:_257 NA18152-SRR007381.329161 246
chr1 875730 878363 CpG:_246 NA18152-SRR007381.732122 327
chr1 933387 937410 CpG:_413 NA18152-SRR007381.925947 169
chr1 1109314 1110145 CpG:_59 NA18152-SRR007381.659411,NA18152-SRR007381.615088,NA18152-SRR007381.677905,NA18152-SRR007381.217465,NA18152-SRR007381.1495841,NA18152-SRR007381.1061710,NA18152-SRR007381.209479,NA18152-SRR007381.293009,NA18152-SRR007381.350684,NA18152-SRR007381.1386200,NA18152-SRR007381.176689,NA18152-SRR007381.369558,NA18152-SRR007381.744765,NA18152-SRR007381.1321023,NA18152-SRR007381.838421,NA18152-SRR007381.991283,NA18152-SRR007381.1385310,NA18152-SRR007381.1039387,NA18152-SRR007381.1380869,NA18152-SRR007381.551813,NA18152-SRR007381.1295807,NA18152-SRR007381.1443162,NA18152-SRR007381.403094,NA18152-SRR007381.130789,NA18152-SRR007381.448068,NA18152-SRR007381.678372,NA18152-SRR007381.1300780,NA18152-SRR007381.160158,NA18152-SRR007381.1454803,NA18152-SRR007381.467939,NA18152-SRR007381.1405856,NA18152-SRR007381.1057252,NA18152-SRR007381.1062561,NA18152-SRR007381.85329,NA18152-SRR007381.722618,NA18152-SRR007381.878135 71,119,33,110,32,131,107,142,374,374,454,314,355,281,331,268,232,226,118,272,280,272,274,157,160,137,202,62,62,54,54,42,25,23,10,10
|
biostars
|
{"uid": 61044, "view_count": 4345, "vote_count": 1}
|
<p>Suppose I have Protein1, Protein2, Protein3 that are expressed by Gene1, Gene2, Gene3. I want to know Gene1, Gene2, Gene3 in the genome sequence are neighbor or not?</p>
<p>Genome: ========Gene1=====Gene2=======Gene3======</p>
|
<p>I suggest you to sort your gff file according to scaffold (chromesome) firstly, and coordinate secondly. they sit at the first column and fourth column, repectively.</p>
<p>REF: http://asia.ensembl.org/info/website/upload/gff.html?redirect=no</p>
|
biostars
|
{"uid": 168707, "view_count": 3808, "vote_count": 1}
|
<p>I have a set of files with genotypic data, each divided into 3 columns of data, including: MARKER, ID, GENOTYPE.</p>
<p>I would like to use AWK (without changing the order/sorting of the files) to perform a VLOOKUP-like command in order to join the data within the files into a single file as follows:</p>
<p>File1:</p>
<pre>
<code>BIEC2-99962 HOR_233 G_G
BIEC2-9997 HOR_233 A_G
BIEC2-999748 HOR_233 C_C
BIEC2-999848 HOR_233 G_G
BIEC2-99989 HOR_233 A_A</code></pre>
<p>File2:</p>
<pre>
<code>BIEC2-9997 HOR_250 A_A
BIEC2-999748 HOR_250 C_C
BIEC2-99989 HOR_250 A_C</code></pre>
<p>File3:</p>
<pre>
<code>BIEC2-9997 HOR_615 A_G
BIEC2-999748 HOR_615 A_C
BIEC2-999848 HOR_615 A_G
BIEC2-99989 HOR_615 A_C</code></pre>
<p>Expected result:</p>
<pre>
<code>BIEC2-99962 G_G NA NA
BIEC2-9997 A_G A_A A_G
BIEC2-999748 C_C C_C A_C
BIEC2-999848 G_G NA A_G
BIEC2-99989 A_A A_C A_C</code></pre>
<p>I would appreciate any help on this.</p>
<p>Thanks!</p>
|
I strongly recommend you against using awk for complex join operations. I would be able to tell you a million stories, about times when I trusted the output of a awk command, only to discover that it didn't run correctly because of some minor mistake or some exception.
This is how I would do it using R and the dplyr package:
```
> library(dplyr)
> bio1 = read.table('bio1')
> bio2 = read.table('bio2')
> bio3 = read.table('bio3')
> bio1 %>%
left_join(
bio2 %>% # join with the second file (only the first and third column)
select(V1, V3),
by='V1') %>%
left_join(
bio3 %>%
select(V1, V3),
by='V1') %>%
mutate_each(
funs(ifelse(is.na(.), 'NA', as.character(.))), starts_with('V3')) # transform all NAs to the string NA
```
|
biostars
|
{"uid": 131688, "view_count": 10165, "vote_count": 3}
|
Hi,
I'm a medical student with genetics, and I have come to understand some knowledge in bioinformatics would help me getting a research position in the field. I've been browsing the internet for some course, but all the ones I've found so far did not suit my needs. Does anyone know of an online bioinformatics course that:
1. is affordable
2. is open to an undergraduate medical student
3. provides a certificate
4. teaches you the most important things for genetic, genomic and molecular biology research
|
You might want to try a few courses that go through the clinical utility of NGS and bioinformatics (although bioinformatics doesn't stop at NGS it is curently one of the main uses)
Genomic Medicine University of Exeter
[https://www.futurelearn.com/courses/diabetes-genomic-medicine][1]
The Genomics Era: the Future of Genetics in Medicine
[https://www.futurelearn.com/courses/the-genomics-era][2]
Clinical Bioinformatics: Unlocking Genomics in Healthcare
[https://www.futurelearn.com/courses/bioinformatics][3]
Cancer in the 21st Century: the Genomic Revolution
[https://www.futurelearn.com/courses/cancer-and-the-genomic-revolution][4]
They only mention bioinformatics briefly, but they do put Genomic technologies and the analysis in the context of what is useful for the clinician.
Probably the next step is to look at variant interpretation and guidelines - which useful if you're heading down the the route of a Clinical Geneticist specialisation (course is not free - although I think it might be distance learning based).
[Post Graduate Certificate in The Interpretation and Clinical Application of Genomic Data (PGCertICAG)][5]
Also most of the content of the courses seems to be currently aimed at either Rare Disease or Cancer genetics and the other major strand - Microbiology / Virology genomics isn't as well covered.
Bioinformatics courses:
For pure bioinformatics courses not necessarily geared towards clinical areas (mainly Coursera ones as mentioned by previous post):
Bioinformatics Specialization
[https://www.coursera.org/specializations/bioinformatics][6]
Bioinformatic Methods I & II
[https://www.coursera.org/learn/bioinformatics-methods-1][7]
[https://www.coursera.org/learn/bioinformatics-methods-2][8]
Genomic Data Science Specialization
[https://www.coursera.org/learn/python-genomics][9]
Also check out courses on Python (or another easy to learn scripting language such as Ruby), R (or another Stats language), possibly SQL and algorithm development.
[1]: https://www.futurelearn.com/courses/diabetes-genomic-medicine
[2]: https://www.futurelearn.com/courses/the-genomics-era
[3]: https://www.futurelearn.com/courses/bioinformatics
[4]: https://www.futurelearn.com/courses/cancer-and-the-genomic-revolution
[5]: http://www.sgul.ac.uk/postgraduate-certificate-in-the-interpretation-and-clinical-application-of-genomic-data
[6]: https://www.coursera.org/specializations/bioinformatics
[7]: https://www.coursera.org/learn/bioinformatics-methods-1
[8]: https://www.coursera.org/learn/bioinformatics-methods-2
[9]: https://www.coursera.org/learn/python-genomics
|
biostars
|
{"uid": 180100, "view_count": 2972, "vote_count": 2}
|
Hi,
I am making PCA plot in R using `PCAtools` for different group of individuals. The are 65 groups in the sample metadata. At the moment, for smaller groups I simply specify color for each of them in `colkey` (for instance, `"Group 1" = "#004181"`, `"Group 2" = "#0077BA"`, ................, etc). I am not sure how to add colors for more number of groups and manually specifying them would be tedious. Is there a better way to do this?
Plot_Type = "PCA2D"
pdf(paste0(Plot_Type,"_PC1_vs_PC2.pdf"),height = 7,width = 10)
biplot(p,
x = 'PC1', y = 'PC2',
lab = NULL,
colby = 'Group', colkey = c('Group 1' = '#004181', 'Group 2' = '#0077BA', 'Group 3' = '#4E564D', 'Group 4' = '#6BA3D7', 'Group 5' = '#8B63FF'),
legendPosition = 'right', legendLabSize = 13, legendIconSize = 3.0,
subtitle = 'PC1 vs. PC2')
dev.off()
I will appreciate any help. Thank you!
Best Regards,
Toufiq
|
Using *rainbow* to create **n** colours, then *setNames* to create a named vector:
# using 5 as a test, change it to as needed, 65?
n = 5
myCols <- setNames(rainbow(n), paste("Group", 1:n))
myCols
# Group 1 Group 2 Group 3 Group 4 Group 5
# "#FF0000" "#CCFF00" "#00FF66" "#0066FF" "#CC00FF"
# then use within your code:
colby = "Group", colkey = myCols,
**Note:**
- No one can tell a difference between 65 colours.
- There are [other packages/functions](https://stackoverflow.com/q/15282580/680068) to create pallets with **n** number of colours, instead of *rainbow*.
|
biostars
|
{"uid": 9505394, "view_count": 2227, "vote_count": 1}
|
I want to annotate my bacterial genomes and metagenomic samples from gut microflora using the Resfams database available from the Dantas lab website http://www.dantaslab.org/resfams but I am not sure how I can apply it to my samples. I am wondering if anyone knows of a script with commands to use the database. I have fastq and fasta files from raw reads and assembled sequences from both whole bacterial genomes as well as metagenomic samples.
|
To annotate your assembled contigs with the Resfams models, you'll need to download [HMMER][1], and produce a 6-frame translation of your contigs, perhaps using a tool like [MetaGeneMark][2]. Use hmmsearch on your fasta of translated sequences and it will output motifs that match to the Resfams models.
Since you already have assembled contigs, your commands might look something like:
gmhmmp -m /path/to/MetaGeneMark_v1.mod -A path/to/output/protein.fasta assembled_contig.fasta
cat path/to/output/protein.fasta | grep -v -e "^$" > path/to/clean_protein.fasta
hmmsearch --tblout path/to/output.tblout.scan /path/to/resfams/models.hmm clean_protein.fasta > /dev/null
Note that the most relevant HMMER output is the tblout file. I usually redirect the full output to /dev/null to reduce clutter. You'll then have to parse the tblout file in whatever way is relevant to your interests. The intermediate step is to remove blank lines from the GeneMark output.
[1]: http://hmmer.org/
[2]: http://exon.gatech.edu/genemark/license_download.cgi
|
biostars
|
{"uid": 194121, "view_count": 4991, "vote_count": 1}
|
Hello,
I'm working for a software company and for one of our project's we need a software to cluster nodes in a phylogenetic tree which have a certain kind of similarity and give them a user defined tag. Preferable the tag consist of two different value's, a unique ID and a human readable name. It would also be nice to set multiple tags for one or several nodes.
Some more in depth information:
We get sequenced data from a laboratory. The first thing the software has to do, is to do an alignment. Based on the aligned data we need a phylogenetic tree. The software now has to give us the possibility to set one or more tags on one or more nodes. After the tagging, the data has to be exported from the software, so that we can give our clients the enriched data.
Phylogenetic tree:
________ M.HpyFI.dna
|
|_______________ M2.HpyFXIII.dna
|
|___________ M.HpyFII.dna
|
| ___ M.HpyFIII.dna
|_______|
| |__________ M.HpyFIV.dna
|
| ________________ M.HpyFVII.dna
|_|
| |__________ M.HpyFXII.dna
______________________________________|
|____________ M.HpyFIX.dna
|
| ________ M.HpyFVI.dna
|___|
| |_________ M.HpyFVIII.dna
|
|_____________ M.HpyFORFX.dna
|
| _________ M.HpyFV.dna
|__|
| |____________ M.HpyFXI.dna
|
|____ M1.HpyFXIII.dna
Phylogenetic tree with tags:
(This graphic just shows what we want to achieve. Every node should get a tag. In the shown case it could also be possible that all nodes get a second tag called citrobacter.)
________ M.HpyFI.dna
|
|_______________ M2.HpyFXIII.dna
|
|___________ M.HpyFII.dna
|
| ___ M.HpyFIII.dna
|_______|
| |__________ M.HpyFIV.dna
|
| ________________ M.HpyFVII.dna
|_|
| |__________ M.HpyFXII.dna
_______________|
|____________ M.HpyFIX.dna
|
| ________ M.HpyFVI.dna (Citrobacter koseri)
|___|
| |_________ M.HpyFVIII.dna (Citrobacter koseri)
|
|_____________ M.HpyFORFX.dna (Citrobacter koseri)
|
| _________ M.HpyFV.dna (Citrobacter freundii)
|__|
| |____________ M.HpyFXI.dna (Citrobacter freundii)
|
|____ M1.HpyFXIII.dna (Citrobacter freundii)
Our company already developed a software for the alignment and the phylogenetic tree which fits our needs with the Biopython package. The question is, if there is already a software (preferable open source) which does everything that we want or if we have to improve our own software.
I hope it is clear what we want to achieve and what we are searching for.
**Edit:**
The text above shows what we have. How we implemented everything with Biopython doesn't have any relevance to this question. I posted it only to show our workflow.
At the moment our software is not able to place user defined tags as shown in the second phylogenetic tree. It is no problem for us to improve our software so that it can do the tagging. But if there exists already a software which can align data, create a phylogenetic tree an can add user defined tags + the export, we would preferably use this software than our software.
As a hint the software MEGA (http://www.megasoftware.net/) can align data and create a phylogenetic tree, but it is not possible to edit/add tags.
I hope the question is now clearer
*In case you want to know which algorithm we used to create the phylogenetic tree: Maximum Likelihood*
|
take a look at the new ETE3 features ( http://mbe.oxfordjournals.org/content/33/6/1635 ).
You can either generate phylogenies using predefined workflows or edit existing trees to add as many labels as you need. Then export as extended newick, or tree images. The [Python AP][1]I should integrate well with your biopython pipeline.
hope it helps
[1]: http://etetoolkit.org/
|
biostars
|
{"uid": 219194, "view_count": 1736, "vote_count": 1}
|
Hi all,
I want to remove all mitochondrial reads from my BAM files, but after doing so the number of mapped reads increased. Here's what I did after indexing:
samtools idxstats .bam | cut -f 1 | grep -v chrM | xargs samtools view -b .bam > clean.bam
However comparing with wc -l says:
samtools view -F 0x904 -c clean.bam
19452291
samtools view -F 0x904 -c .bam
18328474
The second number matches the summary output by tophat2 (fr-frstrand)
any suggestions?
|
Your approach looks pretty strange to me, and I would instead do the following:
samtools view -h yourbam.bam | grep -v 'chrM' | samtools view -b > yourbamwithoutchrM.bam
|
biostars
|
{"uid": 226067, "view_count": 2632, "vote_count": 1}
|
Hello I have a lot of sequences in a FASTA file, and I want to extarct a specific sequence knowing the header ID. for example the header of a sequence is:
NODE_19_length_5758_cluster_19_candidate_1
I know that with `grep` I can extract the header, but i want the below sequences to appear on stdout.
How can I do this on bash?
|
The proposed solutions are probably all fine but have the limitation that they first have to iteratively find the correct sequence which can take time if the file is (very) large. The by far simplest solution would be to use `samtools faidx` which in a first step indexes your fasta file and then can use this index to retrieve any sequence in basically no time. The index generation takes like 10 seconds for the entire mouse genome and is therefore not really a limitation, and it only has to be done once per fasta file:
samtools faidx your.fasta NODE_19_length_5758_cluster_19_candidate_1
For many sequences manually:
samtools faidx your.fasta seq1 seq2 seq(...N)
or if you want it automated
(upstream cmd creating "\n"-sep list of seq.names) | xargs samtools faidx your.fasta
Please be sure to browse existing threads, this has been asked many times before.
https://www.biostars.org/p/49820/
https://www.biostars.org/p/329774/
|
biostars
|
{"uid": 483374, "view_count": 2186, "vote_count": 1}
|
HI,
I have a network in cytoscape and a list of about 40 genes which i want to extract sub-network of these genes from my network, how I can perform this please?
thank you
|
You can check from the wiki [link here][1], that should be handy to perform once you have the network set up. There is Network Analyzer setting which can help you to perform the task. Obviously you have answer here but in case you need a manual to see how to do look at the link.
Also @Jean-Karim Heriche made a similar reply few weeks back about selecting the components from network. Take a look at [this thread.][2]
I would request a bit , please do not think that I am being rude. But just that we already have answer for this question , creating same thread makes it redundant. So before posting if you can try and see threads in Biostars with tags like `cytoscape` and `network` to maximize the usage of the blog to one's benefit. It will be handy for any OP posting here and be more targeted in their query. Just a request.
[1]: http://wiki.cytoscape.org/Cytoscape_3/UserManual#Cytoscape_3.2BAC8-UserManual.2BAC8-Network_Analyzer.Subnetwork_Creation
[2]: https://www.biostars.org/p/186773/
|
biostars
|
{"uid": 197235, "view_count": 5761, "vote_count": 3}
|
Reference
The chromatin accessibility landscape of primary human cancers, M. R. Corces et al., Science 362, eaav1898 (2018). DOI: 10.1126/science.aav1898
This is a recently published paper in Science. Because I am not studying this sort of things, it's hard for me to understand some of those authors' opinions.
![enter image description here][1]
[1]: https://image.ibb.co/m9vLaA/1.png
The Fig. 4A describes the concept the authors used to identify transcription factor occupancy from ATAC-seq data. In the paper, they say **"TF binding to DNA protects the protein-DNA binding site from transposition while the displacement or depletion of one or more nucleosomes creates high DNA accessibility in the immediate flanking sequence"**. Here I think I can understand it correctly: (1) TF binds to this region, and then (2) it blocks Tn5 binding, so (3) consequently there is a deep notch of ATAC-seq signal, and (4) this notch region tells us where a TF binds to.
Later near the end of this article, the authors said:
**(1) For example, if a noncoding somatic mutation causes the generation of a TF binding site, this mutation could lead to an increase in chromatin accessibility in cis and a concomitant increase in the observed frequency of the mutant allele in ATACseq as compared with that in WGS (Fig. 7A). (2) Similarly, a mutation that inactivates a TF binding site can lead to a decrease in chromatin accessibility and a concomitant decrease in the observed frequency of the mutant allele.**
From Fig. 4A we've known that when TF binds to DNA, the ATAC-seq signal plummets. However, the authors now say *the generation of TF binding site increases chromatin accessibility*. **How could this be possible?** Doesn't the generation of TF binding site make chromatin inaccessible?
|
The biological concept is that certain TFs like for example the hematopoietic TF PU.1 binds to the chromatin and opens it up (e.g. by recruiting chromatin remodelers) so that other factors can come in and start their actions like initiating or preparing a region for transcriptional processes. But this then involves the opening of an entire region of like 200-500bp. In contrast, and this is what you are mixing up, is that the TF binding itself protects a tiny part of this open region from Tn cutting events, but this is something like 50bp or so. I attached a plot where you see that in condition blue upon treatment, you see an increased footprint of a certain TF indicating increased binding, but this is a very local event (see the scale on the x-axis). In contrast, the increased binding is also associated with higher overall accessability of the vicinity (see that the flanking regions of this 200bp window show increased readcounts on the y-axis). So do not mix up chromatin accessablity induced by TFs with local binding site protection due to the presence of the TF itself. The latter is simply the consequence of the physical presence of a protein denying access to the ATAC-seq Tn.
![enter image description here][1]
[1]: https://image.ibb.co/etbwFA/Screen-Shot-2018-11-06-at-11-22-04.png
|
biostars
|
{"uid": 347703, "view_count": 4137, "vote_count": 2}
|
Hello everyone !
I'm trying to polish my genome assembly, and for this I need to use Pilon (there other options from PacBio tools and software being unavailable). My problem is that I don't see anywhere some recommendations to install this tool.
I read the several sections form the wiki page : https://github.com/broadinstitute/pilon/wiki , but wasn't able to find it. I found an installation using conda that didn't worked for me.
The steps I accomplished so far, is cloning the pilon deposit from github in my computer. Then, I tried to launch the build.sh script, which gave me the following error :
Loutre:~/pilon$ ./build.sh
./build.sh: 14: ./build.sh: sbt: not found
ln: impossible de créer le lien symbolique «/home/loutre/lib/pilon/pilon-dev.jar»: Aucun fichier ou dossier de ce type
(It says that the file or directory does not exist, which is true in my case).
I think that I missing something. As it's a java source file, I thought about using jar with some other arguments, but there is no single indications in the README.md, and there is so many .scala files in the directory src. I'm kind of lost here.
I saw that some users recommended Pilon to other people, someone also had the same trouble as me ( smkopac) in this post : https://www.biostars.org/p/169796/ when trying to run :
java -Xmx16G -jar lib/htsjdk-1.130.jar pilon --help
Any help or further informations that I may have missed will be really appreciated. I hope that this is not a stupid question.
Cheers,
Roxane
|
I allow myself to add my own answer to this question, in case some other people wonder.
So, clone the deposit is probably not the way we should install Pilon.
I've ran successfully Pilon after directly the .jar file available here : https://github.com/broadinstitute/pilon/releases and then typing on a terminal, where your jar file is located :
java -jar pilon-1.21.jar --help
|
biostars
|
{"uid": 232981, "view_count": 6428, "vote_count": 2}
|
I would like to annotate records in one VCF file (`input.vcf`) with some of the INFO fields of the corresponding records from the database (`db.vcf`), but only if the recorded mutation matches exactly in input and in the database. E. g. let's say I have three very simple VCF files:
`input.vcf`
```
##fileformat=VCFv4.1
#CHROM POS ID REF ALT QUAL FILTER INFO
chr1 878638 . G A 100 PASS A=3.0
```
`db1.vcf`
```
##fileformat=VCFv4.1
#CHROM POS ID REF ALT QUAL FILTER INFO
chr1 878638 . G A 100 PASS B=4.0
```
`db2.vcf`
```
##fileformat=VCFv4.1
#CHROM POS ID REF ALT QUAL FILTER INFO
chr1 878638 . G T 100 PASS B=4.0
```
Note that db1 and db2 describe different SNPs at the same locus; SNP in `db1.vcf` matches with the one in `input.vcf`, but SNP in `db2.vcf` does not. I need a tool that can discern such cases and annotate the input file record with information from database only if the mutations match. Is there a tool to accomplish what I want?
I tried using GATK's VariantAnnotator and vcflib's vcfaddinfo; they unfortunately both ignore information about the mutation and add B=4.0 annotation in both cases.
Just to clarify, this is what I want in the case described:
```
$ some_tool input.vcf db1.vcf # SNP in input and database matches
##fileformat=VCFv4.1
#CHROM POS ID REF ALT QUAL FILTER INFO
chr1 878638 . G A 100 PASS A=3.0;B=4.0
```
```
$ some_tool input.vcf db2.vcf # SNP in input and database do not match
##fileformat=VCFv4.1
#CHROM POS ID REF ALT QUAL FILTER INFO
chr1 878638 . G A 100 PASS A=3.0
```
|
<p>Try bcftools annotate</p>
<pre>
bgzip -c input.vcf > input.vcf.gz; tabix input.vcf.gz
bgzip -c db.vcf > db.vcf.gz; tabix db.vcf.gz
bcftools annotate -a db.vcf.gz -c CHROM,POS,REF,ALT,INFO/B input.vcf.gz > output.vcf</pre>
<p>this will fill in INFO/B from db.vcf.gz when all of CHROM,POS,REF and ALT match.</p>
|
biostars
|
{"uid": 139441, "view_count": 3696, "vote_count": 2}
|
Aloha,
I am having trouble figuring out how to remove everything after the last '_' in the sequence headers of a fasta file.
I would like this following series of headers
>ART01B_100_M7_ID100005_1
TAAGAGGAGGAATTTTTCATAGAGGATTGTCTGTAGACTTAGTAATTTTTTCTCTTCATTTAGCTGGAATTTCTTCTCTT
TTAGGGGCTGTAAATTTTATTACTACAATTCTTAATTGTCGATCTTTAGGGGTTTGGTGAGATGAATTGCCCTTATTTGT
>PAG05A_100_M7_ID102325_189
TAAGAGGAGGAATTTTTCATAGAGGATTGTCTGTAGACTTAGTAATTTTTTCTCTTCATTTAGCTGGAATTTCTTCTCTT
TTAGGGGCTGTAAATTTTATTACTACAATTCTTAATTGTCGATCTTTAGGGGTTTGGTGAGATGAATTGCCCTTATTTGT
>KIN05B_100_M7_ALT_ID230005_46
TAAGAGGAGGAATTTTTCATAGAGGATTGTCTGTAGACTTAGTAATTTTTTCTCTTCATTTAGCTGGAATTTCTTCTCTT
TTAGGGGCTGTAAATTTTATTACTACAATTCTTAATTGTCGATCTTTAGGGGTTTGGTGAGATGAATTGCCCTTATTTGT
to look like this:
>ART01B_100_M7_ID100005
TAAGAGGAGGAATTTTTCATAGAGGATTGTCTGTAGACTTAGTAATTTTTTCTCTTCATTTAGCTGGAATTTCTTCTCTT
TTAGGGGCTGTAAATTTTATTACTACAATTCTTAATTGTCGATCTTTAGGGGTTTGGTGAGATGAATTGCCCTTATTTGT
>PAG05A_100_M7_ID102325
TAAGAGGAGGAATTTTTCATAGAGGATTGTCTGTAGACTTAGTAATTTTTTCTCTTCATTTAGCTGGAATTTCTTCTCTT
TTAGGGGCTGTAAATTTTATTACTACAATTCTTAATTGTCGATCTTTAGGGGTTTGGTGAGATGAATTGCCCTTATTTGT
>KIN05B_100_M7_ALT_ID230005
TAAGAGGAGGAATTTTTCATAGAGGATTGTCTGTAGACTTAGTAATTTTTTCTCTTCATTTAGCTGGAATTTCTTCTCTT
TTAGGGGCTGTAAATTTTATTACTACAATTCTTAATTGTCGATCTTTAGGGGTTTGGTGAGATGAATTGCCCTTATTTGT
because there are various '_' in the sequence headers, this command, for example, won't work:
cat Alt_MACSE_Output.fasta | awk -F _ '/^>/ { print $1"_"$2"_"$3"_"$4 } /^[A-Z]/ {print $1}' > Alt.fasta
Can anyone help me please?
|
Another sed solution:
$ sed '/>/ s/\(.*\)_.*$/\1/g' test.fa
>ART01B_100_M7_ID100005
TAAGAGGAGGAATTTTTCATAGAGGATTGTCTGTAGACTTAGTAATTTTTTCTCTTCATTTAGCTGGAATTTCTTCTCTT
TTAGGGGCTGTAAATTTTATTACTACAATTCTTAATTGTCGATCTTTAGGGGTTTGGTGAGATGAATTGCCCTTATTTGT
>PAG05A_100_M7_ID102325
TAAGAGGAGGAATTTTTCATAGAGGATTGTCTGTAGACTTAGTAATTTTTTCTCTTCATTTAGCTGGAATTTCTTCTCTT
TTAGGGGCTGTAAATTTTATTACTACAATTCTTAATTGTCGATCTTTAGGGGTTTGGTGAGATGAATTGCCCTTATTTGT
>KIN05B_100_M7_ALT_ID230005
TAAGAGGAGGAATTTTTCATAGAGGATTGTCTGTAGACTTAGTAATTTTTTCTCTTCATTTAGCTGGAATTTCTTCTCTT
TTAGGGGCTGTAAATTTTATTACTACAATTCTTAATTGTCGATCTTTAGGGGTTTGGTGAGATGAATTGCCCTTATTTGT
|
biostars
|
{"uid": 336428, "view_count": 4756, "vote_count": 1}
|
Hi All,
I'm trying to make a script that will allow me to take a given genbank file and convert it a fasta and a bed file in the same script so I can then use it with the mapper and viewers downstream. The file conversion itself is pretty straight forward. I'm not sure which of the developers for Biopython made SeqIO.convert but they have all my gratitude. In fact all of Biopython I have found to be really empowering and enjoyable, however as I'm still a inexperienced I'm having some trouble extracting the information I want.
So what I want is the name of the gene, start, stop, and strand just the basics. and when I read in the file I can see this.
```
genome.features
[SeqFeature(FeatureLocation(ExactPosition(0), ExactPosition(1192), strand=1), type='source'),SeqFeature(FeatureLocation(ExactPosition(23), ExactPosition(1127), strand=1), type='gene'), SeqFeature(FeatureLocation(ExactPosition(23), ExactPosition(1127), strand=1), type='CDS')]
```
which I know is a list of the SeqFeatures but I'm having trouble getting to that information so I was exploring and printed what each item was:
```
for I in genome.features:
print(i,type(i))
```
and got:
```
type: source
location: [0:1192](+)
qualifiers:
Key: country, Value: ['USA']
Key: db_xref, Value: ['taxon:38170']
Key: mol_type, Value: ['genomic RNA']
Key: organism, Value: ['Avian orthoreovirus']
Key: segment, Value: ['S4']
Key: strain, Value: ['AVS-B']
<class 'Bio.SeqFeature.SeqFeature'>
type: gene
location: [23:1127](+)
qualifiers:
Key: gene, Value: ['sigma-NS']
<class 'Bio.SeqFeature.SeqFeature'>
type: CDS
location: [23:1127](+)
qualifiers:
Key: codon_start, Value: ['1']
Key: db_xref, Value: ['GI:315466580']
Key: gene, Value: ['sigma-NS']
Key: product, Value: ['sigma-NS protein']
Key: protein_id, Value: ['CBX25032.1']
Key: translation, Value: ['MDNTVRVGVSRNTSGAAGQTVFRNYYLLRCNISADGRNATKAVQSHFPFLSRAVRCLSPLAAHCADRTLRRDNVKQILTRELPFPSDLINYAHHVNSSSLTTSQGVEAARLVAQVYGEQLSFDHIYPTGSATYCPGAIANAISRIMAGFVPHEGDNFTPDGAIDYLAADLVAYKFVLPYMLDIVDGRPQIVLPSHTVEEMLSNTSLLNSIDASFGIESKSDQRMTRDAAEMSSRSLNELEDHEQRGRMPWKIMTAMFAAQLKVELDALADERVESQANAHVTSFGSRLFNQMSAFVPIDRELMELALLIKEQGFAMNPGQVASKWSLIRRSGPTRPLSGARLEIRNGNWTIREGDQTLLSVSPARMA']
<class 'Bio.SeqFeature.SeqFeature'>
```
I know that the Key Value pair means its a dictionary and when I try to just print the genome.features.type I get a list error so I think each feature is a list with two lists and a dictionary inside them but I can not seem to figure out how to extract the information.
Can anybody point me in the right direction in either an explanation or the correct documentation I need to read I would be very grateful.
|
HAHAHAHA!!! after a lot of trial and error and reading I got a script that works. Please find it below is anyone could use it for themselves.
''' file conversion for from genbank to fasta
and to make a bedfile as well. Code modified from
Brant Faircloth's "bed_from_genbank.py" for the bed file
you can find the original code here
https://gist [dot] github [dot] com/brantfaircloth/893580'''
from Bio import SeqIO
import sys
# Lets gets some files
gb_file = sys.argv[1]
lables = gb_file.split(".")
# Producing the bed file, first make a new writeable file and creat header
# Added the line break \n for a cleaner look with a text editor
# sorry my OCD.
out_bedfile = open(lables[0]+".bed", 'w')
bed_header = "Track name="+ lables[0] + " description="+lables[0]+" genes\n"
out_bedfile.write(bed_header)
# loop will work with multi genbank files.
for record in SeqIO.parse(open(gb_file,"rU"),"genbank"):
for feature in record.features:
if feature.type == 'gene':
start = int(feature.location.start)
stop = int(feature.location.end)
try:
name = feature.qualifiers['gene'][0]
except:
#some features only have locus tags
name = feature.qualifiers['locus_tag'][0]
if feature.strand < 0:
strand = "-"
else:
strand = "+"
bed_line = lables[0]+" dna\t{0}\t{1}\t{2}\t1000\t{3}\t{0}\t{1}\n".format(start, stop, name, strand)
out_bedfile.write(bed_line)
out_bedfile.close()
#convert to fasta - so easy (thank you biopython)
SeqIO.convert(gb_file,"genbank",lables[0]+".fasta","fasta")
#### EDIT ####
correct a typo, code should be good now :)
|
biostars
|
{"uid": 173578, "view_count": 1856, "vote_count": 1}
|
Hi,
I am trying to make a Heatmap of some analyzed RNAseq data. I am using ggplot2 with R. The problem I have is that I cannot see well the upregulated and the downregulated genes. I can't get the colors shown to be dark enough. I am doing the heatmap with all the genes of the study organism, around 13,000. I'm also not sure that ggplot2 clusters the genes in my data. Is there a way to cluster the genes and see darker colors in the genes upregulated and the downregulated? The code I am using would be the following:
library(ggplot2)
library(reshape2)
g<-read.csv("datos_prueba3.csv") g3<-melt(g)
plot1 <- ggplot(g3, aes(variable, Gene, fill=value)) + geom_tile() + scale_fill_gradient2(low="dark green", high="dark red", mid="green", midpoint=0) + theme(axis.text.y=element_blank())
plot1
![enter image description here][1]
Best,
[1]: /media/images/f8a7c4c3-4b01-4416-a89d-52e82151
|
Doing a heatmap of 13k genes is not going to be informative, it is just too many data. Try the following points:
a) reduce the number of genes to the most meaningful ones, e.g. the differential ones. All others are not different between days and as such do not add any information
b) standardize your data. Expression data have large spans, both if you plot log-scale expression data or fold changes. In this case the extreme values will dominate the color scale (here it is the -20 on the color gradient). Basically the extreme gradient makes it impossible to see differences, e.g. etween -5 and -10. Scaling means Z-scoring. If you have a numeric matrix of log-expression values called `x` then do `t(scale(t(c)))` to get Z-scored data which indicate for every gene the deviation from its mean of all samples.
c) Cluster your heatmap with `hclust` to group similar expression patterns and visualize them. The `ComplexHeatmap` package can do this internally. Alternatively, if you prefer ggplot style use https://github.com/XiaoLuo-boy/ggheatmap which also has parameters to use hclust.
Does that make sense to you?
|
biostars
|
{"uid": 9491957, "view_count": 1454, "vote_count": 1}
|
I have 2 bed files (Stemloops chrY.bed and heart_fetal chrY.bed ) just simply in 3 column (chrname, start,end), I want to plot density in R to compare them. Also I want to set windows size like per 1mb, 10mb, ...
I started with "GenomeGraphs" from bioconductor tools but couldn't get any beautiful graph from there!
In other words I'm planning to plot a graph like picture above:
![ploting][1]
Also, I read some materials here that I included in list above, so I tried to follow some instruction but couldn't plot image which I supposed to have it.
[Plotting Read Densities And Gene Tracks In R][2]
[Drawing Chromosome Ideograms With Data][3]
So, How I can plot density in R?
[1]: https://imghost.io/images/2017/03/08/test.png
[2]: https://www.biostars.org/p/66226/
[3]: https://www.biostars.org/p/378/
|
Perhaps you want to count the number of elements over windows. This would be a different measurement from the plot you include in your question, which measures DNaseI accessibility, for which you will need a source of DNaseI signal (like reads from a DNaseI-seq assay, etc.).
Nonetheless, if you just want to count generic elements over genomic intervals, here is a way to do this efficiently.
**Measuring signal**
I will assume you have UCSC [Kent Tools][1] and [BEDOPS][2] toolkits installed, which you can get via Homebrew (`brew install kent-tools` and `brew install bedops`) or similar means, depending on your platform.
1. Get the chromosome bounds for your reference genome of interest and parse them into BED. For example, here is how to get a BED file of chromosome extents for `hg38`:
$ fetchChromSizes hg38 | awk 'BEGIN{OFS="\t"}{print $1,"0",$2}' | sort-bed - > hg38.bed
Replace `hg38` with `hg19` or your genome build of choice, if desired.
2. Use `bedops` to chop these bounds into, say, 100k-sized windows, sliding across the genome every 10k:
$ bedops --chop 100000 --stagger 10000 hg38.bed > hg38.chop100k.stagger10k.bed
You would adjust window and sliding parameters, depending on how fine or coarse you want to measure counts (signal) and how much you want them smoothed. Smaller window and sliding values will give you finer and smoother signal, while larger values will give coarser and rougher signal.
*Note:* Since you are only interested in `chrY` (given the description of your inputs) you can focus `bedops` on `chrY` directly to save a considerable amount of time, by adding `--chrom chrY`:
$ bedops --chrom chrY --chop 100000 --stagger 10000 hg38.bed > hg38.chrY.chop100k.stagger10k.bed
3. Sort your BED files, if needed, *e.g.*:
$ sort-bed stemloops.unsorted.chrY.bed > stemloops.chrY.bed
$ sort-bed heart_fetal.unsorted.chrY.bed > heart_fetal.chrY.bed
Make sure to sort your inputs, if you do not know their sort order.
3. Map your files of interest to this windowed chromosome, using `bedmap`. For example, use the `--count` operator to count the number of elements from `stemloops.chrY.bed` that fall over the sliding windows. As with `bedops`, to save time, you can add `--chrom chrY` to `bedmap` to focus work on `chrY`:
$ bedmap --chrom chrY --echo --count --delim '\t' hg38.chop100k.stagger10k.bed stemloops.chrY.bed > hg38.chop100k.stagger10k.stemloopsCount.bed
Now you have a four-column BED file, where you have intervals of sliding windows and the number of elements from the mapped file that fall over those windows. This is also called a BedGraph file format.
You would repeat this for your fetal heart input:
$ bedmap --chrom chrY --echo --count --delim '\t' hg38.chop100k.stagger10k.bed heart_fetal.chrY.bed > hg38.chop100k.stagger10k.fetalHeartCount.bed
**Visualizing signal**
You can import this and other similarly-scored files into [UCSC Genome Graphs][3] to plot their signals over `chrY` (or other chromosomes). You can layer multiple signals and see the chromosome at a glance, and then zoom in a region of interest within the UCSC Genome Browser. You can export a PDF snapshot from both the Genome Graphs and Genome Browser tools.
If you want to use R, you could use `read.table()` to bring in the data and `ggplot2` to plot that data, *e.g.*:
> stemloops <- read.table("hg38.chop100k.stagger10k.stemloopsCount.bed", header=F, sep="\t", col.names=c("chr", "start", "stop", "count"))
> fetal_heart <- read.table("hg38.chop100k.stagger10k.fetalHeartCount.bed", header=F, sep="\t", col.names=c("chr", "start", "stop", "count"))
> df <- data.frame(position=stemloops$start, stemloops=stemloops$count, fetal_heart=fetal_heart$count)
> library(ggplot2)
> ggplot(df, aes(x=position, y=signal, color=variable)) + geom_line(aes(y=stemloops, col="stemloops")) + geom_line(aes(y=fetal_heart, col="fetal_heart"))
Or you could use any number of other visualization libraries in R, like [gviz][4].
[1]: https://github.com/ENCODE-DCC/kentUtils
[2]: https://github.com/bedops/bedops
[3]: https://www.biostars.org/p/235589/#235649
[4]: https://bioconductor.org/packages/devel/bioc/vignettes/Gviz/inst/doc/Gviz.pdf
|
biostars
|
{"uid": 240709, "view_count": 4810, "vote_count": 2}
|
To make a long story short, I have a bam file that is aligned to the human reference plus a specific contig (human gene + viral vector introduced into a mouse).
The fasta file that was used for alignment got inadvertently deleted, but I have good coverage across the contig. Is there a straightforward way to use the reads aligning to that contig to recreate the contig's fasta file? (All the info should be there!)
|
Although reassembly seems the preferred option I thought if Pilon which polishes a reference with standard illumina reads could work . Just for fun I tried following with an ecoli MG1655 bam file.
- Got the length and name of reference chromosome from bam header (in this case only one)
- Created a fake reference with the same name and same number of nucleotides (but all nucleotides were A ; I tried with N and it did not work)
- Then use [pilon][1] and gave the input bam and the fake reference (composed of all A nucleotides) ( I gave as a single end bam but paired should produce better results)
- Pilon generated a fasta (pilon.fasta default name)
- Ran blast2sequence (NCBI;Online) with actual ecoli MG1655 genome)
- Following were the results (99% coverage and 99% identity)
- Dot Plot (https://ibb.co/ifFzjS)
<a href="https://ibb.co/ifFzjS"><img src="https://preview.ibb.co/cPtVr7/two.png" alt="two" border="0" /></a>
- Alignment details (https://ibb.co/hNCejS)
<a href="https://ibb.co/hNCejS"><img src="https://preview.ibb.co/n0yKjS/one.png" alt="one" border="0" /></a>
[1]: https://www.broadinstitute.org/gaag/pilon
[2]: https://ibb.co/ifFzjS
|
biostars
|
{"uid": 313857, "view_count": 2442, "vote_count": 1}
|
<p>I have a set of cDNA-sequences representing mRNAs and I want to create a gtf/gff file of these. I have tried to use BLAST and BLAT, but I find it difficult to obtain a single reliabe hit that represents all the different exons. And especially with BLAT I get many small hits for each sequence. I also tried to map the sequences using TopHat, but for some reason it crashed, perhaps due to the long sequences.</p>
<p>Any suggestions on how to map such sequences to a genome with reliable information about the exon/intron junctions?</p>
|
<p>Use gmap. It was build for that and outputs a gff file with each exon of every sequence in input. Very usefull !</p>
|
biostars
|
{"uid": 139882, "view_count": 3121, "vote_count": 1}
|
Friends,
I have a microarray dataset AGI IDs in row and samples in column and txt file of transcription factor (AGI IDs), my supervisor asked me to find and extract the expression of only genes existed in my transcription factor list in another word I should extract the rows those are transcription factor. as already I need your help
Thank you
|
<p>Take a look at <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/sets.html"><code>?intersect</code></a>.</p>
<pre>
> v1 <- c("GATA1", "CTCF", "HOXB1")
> v2 <- c("C3", "ATF", "SOX1", "CTCF", "OCT3")
> intersect(v1, v2)
[1] "CTCF"
> </pre>
<p>If you are trying to build a subset of a data frame, you can use <code>%in%</code>. See the examples <a href="http://www.ats.ucla.edu/stat/r/faq/subset_R.htm">here</a>.</p>
|
biostars
|
{"uid": 163635, "view_count": 29116, "vote_count": 2}
|
I installed [pygr][1] and its prerequisites.
Running:
```
>>> from pygr import worldbase
>>> dir(worldbase)
['0root', '0version']
```
Where it was supposed to return
['Bio']
according to the documentation (root and version are empty).
Am I doing something wrong?
By the way, this package is five years old and nothing has been contributed to it since. Which leads me to wonder: is the *worldbase* database still maintained at UCLA?
For the curious, what I want to do next is:
```
hg17 = worldbase.Bio.Seq.Genome.HUMAN.hg17()
chr1 = hg17['chr1']
```
[1]: https://code.google.com/p/pygr/
|
My experience is that pygr is not maintained anymore. I actually made https://www.biostars.org/p/93364/ as a pygr-compatible interface. You'll find that it works with more or less the same API as pygr, and if you find something that doesn't work the way you want it please tell me and I'll do my best to add it! To work with hg17, 18, or 19 you can just download a multifasta file and pass it to the `Fasta` class. From there you can do what you're attempting and use the reference like a dictionary.
|
biostars
|
{"uid": 105443, "view_count": 2244, "vote_count": 1}
|
Does anyone know if there is any available code for an interactive web-based ideogram viewer? It would likely be written in javascript. I want to show an ideogram that dynamically displays some annotations (genes related to a phenotype search, for example).
I have found [this ideogram viewer][1], but it is under copyright and the code has not been made available. There is also [Phenogram][2], which looks nice, but is unfortunately only static images. I want to integrate this into a tool I'm building, so existing web-based genome browsers that have ideograms are not sufficient.
Thanks.
[1]: http://bioinformatics.mdanderson.org/ideogramviewer/Ideogram.html?genelist1=TP53&genelist2=ERBB4&mirlist1=hsa-let-7a-2&mirlist2=hsa-let-7c
[2]: http://visualization.ritchielab.psu.edu/phenograms/examples
|
I just came across this, and got it up and running quite easily:
https://www.ebi.ac.uk/Tools/biojs/registry/Biojs.Chromosome.html
Pretty much exactly what I was looking for in my original question.
|
biostars
|
{"uid": 109791, "view_count": 4808, "vote_count": 1}
|
Hi!
We are planning some GBS sequencing experiment. We have the whole genome sequence of organism of interest. But we'd like to test in silico numerous restriction enzymes to choose the best one for our experiment. I wondering, is there any ready program to do that? Particularly, count number of restriction sites in the genome for one or two different enzymes, make distribution of restriction fragment lengths etc. Thanks!
|
Apparently, there are several, see these threads:
[Q: In Silico Genome Digestion ?][1]
[Q: Restriction Sites Fragments For Gbs/Ddrad][2]
[Q: how to find the total number of recognition sequence of a restriction enzyme in total human genome ?][3]
Also, see these papers:
https://www.ncbi.nlm.nih.gov/pubmed/27288885
https://www.ncbi.nlm.nih.gov/pubmed/27071032
[1]: https://www.biostars.org/p/948/
[2]: https://www.biostars.org/p/97219/
[3]: https://www.biostars.org/p/173054/
|
biostars
|
{"uid": 263289, "view_count": 2562, "vote_count": 1}
|
I want to convert a list of fasta ( protein sequences) in a .text file into corresponding nucleotide sequences. A Google search gives me result of DNA to protein conversion but not vice versa. Also, I came across How do I find the nucleotide sequence of a protein using Biopython?, but this is what I am not looking for. Is there any possible way to do it using python.Moreover, I would like to solve it using python programming. I am sure there must be some way to do it rather than writing a code from scratch. Thanks!
|
As lieven.sterck points out: this returns you 'a' backtranslation of a peptide sequence. You could use a more dedicated statistical model using codon frequencies from your organism under study, but this is the gist of it:
import random
AA2NA = {
"A": list("GCT,GCC,GCA,GCG".split(",")),
"R": list("CGT,CGC,CGA,CGG,AGA,AGG".split(",")),
"N": list("AAT,AAC".split(",")),
"D": list("GAT,GAC".split(",")),
"C": list("TGT,TGC".split(",")),
"Q": list("CAA,CAG".split(",")),
"E": list("GAA,GAG".split(",")),
"G": list("GGT,GGC,GGA,GGG".split(",")),
"H": list("CAT,CAC".split(",")),
"I": list("ATT,ATC,ATA".split(",")),
"L": list("TTA,TTG,CTT,CTC,CTA,CTG".split(",")),
"K": list("AAA,AAG".split(",")),
"M": list("ATG".split(",")),
"F": list("TTT,TTC".split(",")),
"P": list("CCT,CCC,CCA,CCG".split(",")),
"S": list("TCT,TCC,TCA,TCG,AGT,AGC".split(",")),
"T": list("ACT,ACC,ACA,ACG".split(",")),
"W": list("TGG".split(",")),
"Y": list("TAT,TAC".split(",")),
"V": list("GTT,GTC,GTA,GTG".split(",")),
"*": list("TAA,TGA,TAG".split(","))
}
def aa2na(seq):
na_seq = [random.choice(AA2NA.get(c, ["---"])) for c in seq]
return "".join(na_seq)
print("MARNDCQEGHILKMFPSTWYV*", aa2na("MARNDCQEGHILKMFPSTWYV*"))
One possible output:
MARNDCQEGHILKMFPSTWYV* ATGGCTCGAAATGACTGCCAAGAGGGACACATTCTTAAAATGTTTCCGAGTACCTGGTACGTCTAA
Edit: changed return value of AA2NA.get() for "unknown" amino acids to "---" instead of "-".
|
biostars
|
{"uid": 421074, "view_count": 4148, "vote_count": 2}
|
Hello,
I would like to have a complete list of genes that are validated targets of microRNA regulation in R.
I have tried getting a complete list of microRNA using the biomaRt package (list of ~1800 microRNA) then input the list to the get_multimir function from the multimir package to retrieve validated miRNA -target gene interaction. In the end I got ~11 000 target genes! This would suggest that over 50% of genes are under microRNA regulation. I guess I did something wrong at some step but I can't figure it out!
Is there a better way to retrieve the complete target gene list?
PS.
This is my first post on this forum, sorry if I didn't pose my question correctly! Any advice is appreciated.
|
For the purposes of `multimir` "validated" can include any interaction supported by CLASH/PAR-CLIP/AGO-CLIP data. In this case I'm surprised the number is as low as 50%.
|
biostars
|
{"uid": 9464810, "view_count": 582, "vote_count": 1}
|
Hi.
I'm using [edgeR][1] for differential expression analysis of RNASeq data (counts downloaded from TCGA).
The workflow I'm using follows the GLM functionality of edgeR, as described in the vignette for edgeR.
```
dge <- DGEList(...)
design <- model.matrix(...) # non-singular
y <- estimateGLMCommonDisp(dge, design)
y <- estimateGLMTrendedDisp(y, design)
y <- estimateTagwiseDisp(y, design)
fit <- glmFit(y, design)
lrt <- glmLRT(fit, coef = ncol(design) + c(-1,0))
```
Fitting the model, as above, can take ages on our server - seemingly because the dataset is pretty large, the design matrix is pretty large etc etc AND, only a single processor is used by edgeR.
I can't find any options within edgeR that can take advantage of parallel processing and was wondering whether any of the alternative RNASEq expression packages, such as DESeq, had this capability
All the best
Russ
[1]: http://www.bioconductor.org/packages/release/bioc/html/edgeR.html
|
I'm currently working on a parallel wrapper for DESeq2. The dispersion estimation for parallel execution is easy, but I need a bit more time to restructure for the LFC calculation.
As Steve mentions, limma is very fast when you have many 100s of samples as in TCGA.
|
biostars
|
{"uid": 111266, "view_count": 5726, "vote_count": 1}
|
Hi All,
I've tried a few different search engines but I thought I'd put this question out there so there can be an active discussion. Any opinions?
|
I would suggest to get a go with <a href="http://proteomics.ucsd.edu/software-tools/ms-gf/">MSGF+</a>; it's cross-platform (java) and quite fast.
|
biostars
|
{"uid": 125856, "view_count": 2327, "vote_count": 1}
|
The GATK output vcf file contains genotypes in which alleles could be separated both by vertical bar ("|") and slash symbols ("/"). For example: 0/1, 0|1, 0/0, 1|1. I found the explanation at [EBI][1] portal. It is said that
> The vertical pipe | indicates that the genotype is phased, and is
> used to indicate which chromosome the alleles are on. If this is a
> slash / rather than a vertical pipe, it means we don’t know which
> chromosome they are on.
Does this statement correct for GATK output?
[1]: https://www.ebi.ac.uk/training/online/course/human-genetic-variation-introduction/exercise-title/want-know-how-we-did-it
|
>Does this statement correct for GATK output?
The very page you linked says so. This is part of the [VCF specifications][1], so all correctly formatted vcf files should abide to it:
- /: genotype unphased
- |: genotype phased
[1]: https://samtools.github.io/hts-specs/VCFv4.2.pdf
[2]: https://samtools.github.io/hts-specs/VCFv4.2.pdf
|
biostars
|
{"uid": 381655, "view_count": 2961, "vote_count": 1}
|
It might be a very stupid question for many of you but, since it's my first variant calling, I didn't figure it out yet.
I have **mpileup**'ped two bam files from two samples, then I filtered the results with **vcfutils.pl** and called the genotypes with **bcftools** **call**. Now I have a **VCF** file containing what I want, but I managed to analyze differences only between the two samples and the reference (which is an assembly coming from a line that is *different* *from both* *samples*).
I have the variants between my two samples and the assembly, but what if I want to detect the differences **between** the two samples? I did it with awk / sed / cut and other command line tools but is there maybe a better and more straight-forward way to do that? Perhaps using bcftools? Up to know, I didn't find it.
Any suggestion appreaciated!
EDIT:
I did it with bcftools gtcheck as well, that works fine. I am asking if there are **other** reliable tools to test!
EDIT 2:
As this post has many views now, I guess it will be useful for everyone to know that I used **bcftools isec** and it worked brilliantly.
|
I'm a big fan of vt for this.
http://genome.sph.umich.edu/wiki/Vt#Peek
#summarizes the variants found in sample.vcf
vt peek sample.vcf
Also bedtools is very flexible and can work with VCF files so I would use bedtools intersect for this task.
Others have mentioned database joins to be useful too:
http://www.gettinggeneticsdone.com/2013/11/using-database-joins-to-compare-results.html
|
biostars
|
{"uid": 224919, "view_count": 16415, "vote_count": 14}
|
Hello, I am trying to cluster a graph but I am running into an error I cannot solve.
I am running the following command:
```
mcl graph.txt -I 1.5 -o outputs/mcl_cluster -te 4 -V all
```
The paths to graph.txt and outputs/mcl_cluster are specified correctly and the graph.txt looks like this:
```
(mclheader
mcltype matrix
dimensions 49347x49347
(mclmatrix
begin
0 4195:0.3275488069414316 $
1 1:0.6507592190889371 $
2 2:0.6507592190889371 $
3 3:0.6507592190889371 $
4 4:0.6507592190889371 $
5 5:0.6507592190889371 $
...
49344 25696:0.3275488069414316 $
49345 47268:0.3275488069414316 $
49346 33405:0.3275488069414316 $
49347 21194:0.3275488069414316 $
)
```
The error message I get is:
```
___ [mclxaRead] (mclmatrix section not found
___ [mcl] no jive
___ [mcl] failed
```
Any idea of why this is happening?
Thank you very much!
|
At the very least you are missing a right parenthesis between the `mclheader` and `mclmatrix` sections. It should be like this:
(mclheader
mcltype matrix
dimensions 49347x49347
)
(mclmatrix
begin
That empty line after `begin` may need to be removed as well.
|
biostars
|
{"uid": 9507663, "view_count": 303, "vote_count": 1}
|
I can't figure out how to use the "-match" syntax even after reading all the documentation I could find. I get these errors:
```
$ cat xml.txt | xtract -pattern Gene-commentary -match Gene-commentary_type:1
Unrecognized argum`ent '-match'
No -element before 'Gene`-commentary_type:1'
$ cat xml.txt | xtract **-element** Gene-commentary -match Gene-commentary_type:1
Unrecognized argument '-match'
No -element before 'Gene-commentary_type:1'
```
**What am I doing wrong?**
---
What I am trying to do is pull the accession of the reference sequence and the coordinates for the region for a given entry in NCBI Gene (see https://www.biostars.org/p/122522/) so that I can run `efetch -format FASTA -seqstart -seqend` and get the appropriate results.
I could parse the XML in python to do it, but it really seems like I should be able to do this in "one line" using entrez direct if only I could get `-match` to work :/
Here is what the XML looks like:
Say I have a gene record in XML
epost -db gene -id 672 | efetch -format xml > xml.txt
According to the outline,
```
cat xml.txt | xtract -outline
<Gene-commentary>
<Gene-commentary_type value="genomic">1</Gene-commentary_type>
<Gene-commentary_heading>Reference assembly</Gene-commentary_heading>
<Gene-commentary_label>RefSeqGene</Gene-commentary_label>
<Gene-commentary_accession>NG_005905</Gene-commentary_accession>
<Gene-commentary_version>2</Gene-commentary_version>
<Gene-commentary_seqs>
<Seq-loc>
<Seq-loc_int>
<Seq-interval>
<Seq-interval_from>92500</Seq-interval_from>
<Seq-interval_to>173688</Seq-interval_to>
```
I have read:
https://www.biostars.org/p/94539/
http://www.ncbi.nlm.nih.gov/books/NBK179288/ (I followed these instructions to install it, so `which epost` returns `~/edirect/epost`)
http://www.ncbi.nlm.nih.gov/news/02-06-2014-entrez-direct-released/?campaign=facebook-02072014
http://elane.stanford.edu/laneconnex/public/media/documents/EntrezDirect.pdf
|
From a bit of experimentation with 'xtract' it appears that the order of the command-line arguments is important, and thus a use of '-match' must be followed by an '-element' option. This appears to be the source of the error message you receive.
Using just 'xtract' the closest I've gotten so far is:
```
cat xml.txt | edirect/xtract \
-pattern Gene-commentary \
-match 'Gene-commentary_type:1' \
-element 'Gene-commentary_accession' Seq-interval
```
You may be able to further anchor the patterns to make the extraction more specific.
|
biostars
|
{"uid": 122680, "view_count": 2962, "vote_count": 2}
|
Hi all, I am reading paper'A high-resolution map of the three-dimensional' chromatin interactome in human cells. I downlaod their Hi-C data from GEO(GSM1154024) for IMR90 Cell Line.This is used for genome regions interaction.I download the .txt version. The line in this file looks like as follows:
```
HWI-ST216_0375:2:1206:9502:51416#0 chr1 148 - chr19 63789745 -
HWI-ST216_0375:2:1215:19504:87026#0 chr1 6071 - chr13 50507738 -
...
```
As reading above result, I get confused. I know two regions are interacting, like
(chr1 148 -)<->(chr19 63789745-), this two regions should be interacting. But it should be two regions instead of position.I do not know what does 148 and 63789745 means in this dataset.My familiar format should be like (148-500)<->(63789745-63789999),a region map to another region. Any one could help me out how to read result from this paper? Thanks.
|
Hi Jesse,
In order to understand this paper, you need to first understand the 3C-based technologies and how the experiment is performed. Please have a look at this review which will help you understand these technologies. You specifically want to focus on 3C part and then move to the HiC the part.
[A decade of 3C technologies: insights into nuclear organization][1]
You also want to read and understand the original HiC paper to understand what a looping interaction means: [Comprehensive mapping of long range interactions reveals folding principles of the human genome][2]
<a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2858594/"><img alt="" src="http://www.sciencemag.org/content/326/5950/289/F1.large.jpg" style="height:589px; width:800px" /></a>
Overview of Hi-C.
(A) Cells are cross-linked with formaldehyde, resulting in covalent links between spatially adjacent chromatin segments (DNA fragments: dark blue, red; Proteins, which can mediate such interactions, are shown in light blue and cyan). Chromatin is digested with a restriction enzyme (here, HindIII; restriction site: dashed line, see inset) and the resulting sticky ends are filled in with nucleotides, one of which is biotinylated (purple dot). Ligation is performed under extremely dilute conditions to create chimeric molecules; the HindIII site is lost and a NheI site is created (inset). DNA is purified and sheared. Biotinylated junctions are isolated with streptavidin beads and identified by paired-end sequencing.
(B) Hi-C produces a genome-wide contact matrix. The submatrix shown here corresponds to intrachromosomal interactions on chromosome 14. Each pixel represents all interactions between a 1Mb locus and another 1Mb locus; intensity corresponds to the total number of reads (0-50). Tick marks appear every 10Mb.
(C, D) We compared the original experiment to a biological repeat using the same restriction enzyme (C, range: 0-50 reads) and to results with a different restriction enzyme (D, range: 0- 100 reads, NcoI).
The topological domains comes later which are basically regions of genome where the elements involved in looping tends to happen in one domain.
I hope this helps a bit.
[1]: http://genesdev.cshlp.org/content/26/1/11.full
[2]: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2858594/
|
biostars
|
{"uid": 124333, "view_count": 19503, "vote_count": 4}
|
I have a file contain multiple gene >sequences. I want to separate into a file with gene ID perl or python script
|
As others have mentioned this is answered a lot on the forum. But I can't help myself when it comes to trying to make `bash` do this sort of thing (sequences will have to be linearised).
#!/bin/bash
i=1;
while read line ; do
if [ ${line:0:1} == ">" ] ; then
echo "$line" >> seq"${i}".fasta
else
echo "$line" >> seq"${i}".fasta
((i++))
fi
done < $1
Usage:
$ bash splitfasta.sh multifasta.fasta
Disclaimer:
You should always use a proper parser though (like biopython) as it'll catch many of the special cases. My code just has the bonus of not requiring anything to be installed to run.
|
biostars
|
{"uid": 273248, "view_count": 8436, "vote_count": 2}
|
Hello everyone.
I need a code that can give me chunks of secondary structure elements from a given RNA structure and its sequence. e.g. if I have a sequence and its structure like this:
sequence: UGCCCUAGUACGAGAGGACCGGAGUG
Structure: `...(((........))).........`
I should be able to get the output like:
```
Loop1: UGC
Loop2: AGUACGAG
Loop3:GGAGUG
Stem1: CCUAGG
```
The position of every dot corresponds to the position of it respective nucleotide. I have written this code but it gives me all the nucleotides which form loop as one string and all those forming stems as one string. I want fragments.
|
So, just for my own perl coding practice, I wrote the following code that will do what you want (without explicit debugging though...). This programme will take in one file, where the first line is the sequence and the second line is the structure, and generate the required output
```
#!/usr/bin/perl
use warnings;
use strict;
open FILE, "<", $ARGV[0] or die $!;
my $count = 0;
my $seq;
my $structString;
while (<FILE>) {
if($count == 0){
$seq = ($_);
$count = 1;
}elsif($count==1){
$structString = ($_);
last;
}
}
close FILE;
my @seqCharacter = split //, $seq;
my @structChar = split //, $structString;
my $loopCount=1;
my $stemCount=1;
my $currentLoop="";
my @stemStore;
my @stemName;
my $prevChar="";
for(my $i = 0; $i < @structChar; $i=$i+1){
if($prevChar eq ""){ #The first character
if($structChar[$i] eq "."){
$currentLoop = $seqCharacter[$i];
$prevChar = ".";
}elsif($structChar[$i] eq "("){
$stemStore[0]=$seqCharacter[$i];
$stemName[0] = "stem".$stemCount;
$stemCount=$stemCount+1;
$prevChar="(";
}else{
print "Undefined input, structure must start with either ( or .\n";
die;
}
}elsif($prevChar eq "." && $structChar[$i] eq "."){ #Continuation
$currentLoop=$currentLoop.$seqCharacter[$i];
}elsif($prevChar eq "." && $structChar[$i] eq "("){ #Encounter stem
print "loop".$loopCount.": ".$currentLoop."\n";
$loopCount = $loopCount+1;
$currentLoop = "";
$prevChar = "(";
my $size = @stemStore;
$stemStore[$size]=$seqCharacter[$i]; #we have a new stem
$stemName[$size] = "stem".$stemCount;
$stemCount = $stemCount+1;
}elsif($prevChar eq "." && $structChar[$i] eq ")"){
if(@stemStore == 0){
print "Unmatched ) please check your input\n";
die;
}else{
print "loop".$loopCount.": ".$currentLoop."\n";
$loopCount = $loopCount+1;
$currentLoop = "";
$stemStore[@stemStore-1]=$stemStore[@stemStore-1].$seqCharacter[$i]; #Add this to the last loop so we can close it
$prevChar = ")";
}
}elsif($prevChar eq "(" && $structChar[$i] eq "("){
$stemStore[@stemStore-1]=$stemStore[@stemStore-1].$seqCharacter[$i]; #Continue
}elsif($prevChar eq "(" && $structChar[$i] eq "."){
$prevChar = ".";
$currentLoop = $seqCharacter[$i];
}elsif($prevChar eq "(" && $structChar[$i] eq ")"){
$prevChar = ")";
$stemStore[@stemStore-1]=$stemStore[@stemStore-1].$seqCharacter[$i];
}elsif($prevChar eq ")" && $structChar[$i] eq ")"){
$stemStore[@stemStore-1]=$stemStore[@stemStore-1].$seqCharacter[$i]; #Add to the last loop
}elsif($prevChar eq ")" && $structChar[$i] eq "."){
$prevChar = ".";
print $stemName[@stemName-1].": ".$stemStore[@stemStore-1]."\n";
pop(@stemName);
pop(@stemStore);
}elsif($prevChar eq ")" && $structChar[$i] eq "("){
$prevChar = ")";
print $stemName[@stemName-1].": ".$stemStore[@stemStore-1]."\n";
pop(@stemName);
pop(@stemStore);
}
}
#output remaining
if($currentLoop ne ""){
print "loop".$loopCount.": ".$currentLoop."\n";
}elsif(@stemName != 0 && $prevChar eq ")"){
print $stemName[@stemName-1].": ".$stemStore[@stemStore-1]."\n";
pop(@stemName);
pop(@stemStore);
}else{
print "There are unmatched stem remaining\n";
}
```
|
biostars
|
{"uid": 133492, "view_count": 3571, "vote_count": 2}
|
I am trying to install bcl2fastq from source.
However, during the make process, I am encountering an error:
make[2]: *** [c++/lib/demultiplex/CMakeFiles/casava_demultiplex.dir/BclDemultiplexer.cpp.o] Error 1
make[1]: *** [c++/lib/demultiplex/CMakeFiles/casava_demultiplex.dir/all] Error 2
make: *** [all] Error 2
Does anyone know how you can get around this, and what this means? I have built the boost that comes with the redist folder and have pointed to this when configuring the bcl2fastq program.
|
Please download bcl2fastq2-v2.17.1.14-Linux-x86_64.rpm from above link and follow the instructions below: (copy/pasted from: https://github.com/igorbarinov/bcl2fastq/blob/master/install-2.17.sh)
sudo apt-get install alien --assume-yes
sudo alien bcl2fastq2-v2.17.1.14-Linux-x86_64.rpm
sudo dpkg -i bcl2fastq2_0v2.17.1.14-2_amd64.deb
I was able to generate deb (bcl2fastq2_0v2.17.1.14-2_amd64.deb) and install it. Let us know if you are not able to generate deb. bcl2fastq is available in /usr/local/bin.
my system:
$ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18.2
DISTRIB_CODENAME=sonya
DISTRIB_DESCRIPTION="Linux Mint 18.2 Sonya
Linux mint 18.2 is based on ubuntu xenial (16.0.4)
$ uname -a
Linux genomics 4.8.0-53-generic #56~16.04.1-Ubuntu SMP Tue May 16 01:18:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
For some reason, if you fail to generate deb, i can upload the deb file and share a link to download.
|
biostars
|
{"uid": 266897, "view_count": 13007, "vote_count": 2}
|
I want to remove the decimal from the ensembl gene ID ,since it contains the decimal point it becomes difficult when i try to map the same to gene name .
gene "nH1.bam" "nH2.bam" "nH3.bam" "nH4.bam"
"ENSG00000238164.4" -0.6534833425 -0.6404869759 -0.5898568965 -0.586357257
"ENSG00000049249.6" 1.0589150487 0.2235087421 0.5028436068 0.5201173416
I want this in my gene field "ENSG00000049249" instead of this "ENSG00000049249.6"
I tried this `awk '{gsub(/\..*$/,$1)}1'` it seems it messing up the data frame im not sure what im doing wrong.
Any help or suggestion would be highly appreciated
|
sed 's/\(ENSG[0-9]*\)\.[0-9]*/\1/g' input.txt
|
biostars
|
{"uid": 272903, "view_count": 4911, "vote_count": 1}
|
I am using JunctionSeq to test for differential exon and splice junction usage in a paired-end RNA-seq experiment and have a question about how the package computes effect sizes using linear contrasts.
Experimental design: my main condition variable is a drug treatment with **three** levels: vehicle, acute drug, chronic drug. However, to acquire the RNA I use an affinity purification that generates **two** biochemical fractions: "input" and "bound" RNA. Input is RNA from the whole tissue before affinity purification, bound is RNA enriched during affinity purification. As a note, I have enough biological replicates to calculate the dispersion.
My question: I am interested in the drug effect, but specifically as it co-varies with the biochemical fraction as there is variation in the dissection and biochemistry that is captured by the fraction variable. Thus, in my final model, I have drug treatment (condition) and fraction (co-variate). I have incorporated the co-variate into my GLM test formulas exactly as described in Section 8.2 of the user manual (p. 40-41, Advanced Generalized Linear Modelling). substituting my fraction variable for the Smoker variable. In Section 7.5 of the user manual (p. 37, Parameter Estimation), it states that linear contrasts using the Beta parameter estimates are used to the calculate the effect size (fold-change), and that co-variates can be incorporated during the process. *So my main question is the following:* By default, if I run a JunctionSeq analysis with the appropriate test.formulae, are all parameter estimates used in the calculation of fold-change?
|
Yes, most of these programs use a call to lm or glm (JunctionSeq uses glm negative binomial) in R as a subroutine, and those calls use the formula to build their models, so if it's in the formula, it will be used to calculate the eventual fold-change. Here's why:
The formula is translated into a model matrix and the data are fit to that matrix; if the covariate is in the model formula, then the data will be fit to that coefficient as well, as there is now a new column in the model matrix. This will affect the coefficient estimate for the main effect you wish to model, as some of the data are now explained by the fit to the covariate's coefficient, which detracts from the data used to fit the main effect (this is the desired effect in most situations). You can see this process for yourself by playing around with it a bit in R:
library(datasets)
data(mtcars)
# Using a single fixed effect
one.effect <- model.matrix(mpg ~ 1 + hp, data=mtcars)
one.effect
(Intercept) hp
Mazda RX4 1 110
Mazda RX4 Wag 1 110
Datsun 710 1 93
...
Ferrari Dino 1 175
Maserati Bora 1 335
Volvo 142E 1 109
attr(,"assign")
[1] 0 1
lm(mpg ~ 1 + hp, data=mtcars)
Call:
lm(formula = mpg ~ 1 + hp, data = mtcars)
Coefficients:
(Intercept) hp
30.09886 -0.06823
# Using two fixed effects (second being the "covariate", which is somewhat of a misnomer)
two.effects <- model.matrix(mpg ~ 1 + hp + wt, data=mtcars)
two.effects
(Intercept) hp wt
Mazda RX4 1 110 2.620
Mazda RX4 Wag 1 110 2.875
Datsun 710 1 93 2.320
...
Ferrari Dino 1 175 2.770
Maserati Bora 1 335 3.570
Volvo 142E 1 109 2.780
attr(,"assign")
[1] 0 1 2
lm(mpg ~ 1 + hp + wt, data=mtcars)
Call:
lm(formula = mpg ~ 1 + hp + wt, data = mtcars)
Coefficients:
(Intercept) hp wt
37.22727 -0.03177 -3.87783
EDIT: For those who are interested in the the topic of regression-based modeling, I highly recommend the book "Data Analysis Using Regression and Multilevel/Hierarchical Models" by Andrew Gelman and Jennifer Hill. It presumes only an introductory understanding of statistics, covers most practical topics in regression, and has example R/BUGS code. For those who are further interested in modern Bayesian Gibbs samplers, I also recommend "Doing Bayesian Data Analysis" by John Kruschke, which focuses on R and Stan (a C-based Gibbs sampler that is highly efficient and versatile).
|
biostars
|
{"uid": 231462, "view_count": 1413, "vote_count": 2}
|
I use picard software to mark duplicates, and here is my command:
```
java -d64 -server -XX:+UseParallelGC -XX:ParallelGCThreads=2 -Xms8g -Xmx16g -Djava.io.tmpdir=tmp -jar ./picard.jar MarkDuplicates I=input.bam O=out_markdup.bam METRICS_FILE=out.metrics ASO=coordinate VALIDATION_STRINGENCY=LENIENT
```
It works well but when the `input.bam` file gets bigger, the speed is very slow! I found that the picard MarkDuplicates doesn't support multiple threads. So, is there anyway to speedup picard? Another way, is there any better software to do the same as picard MarkDuplicates but with less time? I know [elprep](https://github.com/ExaScience/elprep) is another choice, but it needs very large memory!
Besides, I found that samtools can also remove duplicates, but according to my search, samtools can not remove the duplicates cross different chromosomes, so picard is more universe.
Any reply will be much appreciated!
|
Use `clumpify.sh` from BBMap suite (https://www.biostars.org/p/225338/ ). You do not need to align the data. Clumpify can address all types of duplicates (PCR, optical and so on).
|
biostars
|
{"uid": 249290, "view_count": 5708, "vote_count": 2}
|
Hi all,
For plotting heatmap, I used pheatmap just by taking numerical values but not sure how to annotate and to divide heatmap based on column category.
Code which I used just taking numeral value;
x <- read.table("pheatmap.txt",sep="\t",head=T,row.names=1,check.names=F)
library('pheatmap')
pdf("16s.pdf", height=20,width=13)
pheatmap(x,scale="row",color =colorRampPalette(c('blue','yellow'))(12),cluster_cols =F,show_colnames = T,cluster_row=T,border_color="NA", fontsize_row=10,fontsize =10)
dev.off();
Now Could you please help how should I take only numerical value from the below file for pheatmap and then how to divide the plot into three different category; leaf, root, soil, and then want to add a color bar on top based on season?
Season dry dry wet wet dry dry wet wet dry dry wet wet
Compartment Leaf Leaf Leaf Leaf Root Root Root Root Soil Soil Soil Soil
Burkholderiaceae0 0 0 0.103 0.244 0.001 0.143 0.08 0.032 0.01 0.01 0.032
Bradyrhizobium 0 0 0 0 0.1354 0.094 0.12 0.16 0.211 0.005 0.00744 0.006
Anaeromyxobacter0.04 0 0 0 0.0874 0.139 0.058 0.07 0.11 0.06 0.026 0.034
Geobacter 0.001 0.0004 0 0 0.01 0.016 0.0146 0.08 0.016 0.05 0.0283 0.02
Microbacterium 0.31 0 0.02 0.038 0.003 0.03 0.0038 0.0 0 0.002 0.008 0.002
Rhizobiales 0 0 0 0 0.008 0.001 0.011 0.01 0.0121 0.01 0.4 0.0164
I would like to get image like this and also shown in this publication Fig1 (https://www.nature.com/articles/s41396-021-00974-2); instead of soil type I want to have Compartment; leaf, root, soil and then season (wet/dry) at the top
Many thanks,
[1]: https://i.ibb.co/1994gFN/GENERA.jpg
|
I would approach this problem in the following way: **first**, convert the column names in your count matrix to sample names; **second**, generate a second data.frame with the factors you want to divide the plot by. Then, you can use the ``annotation_col`` parameter to divide the plot in the way you want.
A simplified example of this is shown below:
> matrix <- structure(list(S1 = c(0, 0, 0.04, 0.001, 0.31, 0),
S2 = c(0, 0, 0, 4e-04, 0, 0),
S3 = c(0, 0, 0, 0, 0.02, 0),
S4 = c(0.103, 0, 0, 0, 0.038, 0),
S5 = c(0.244, 0.1354, 0.0874, 0.01, 0.003, 0.008),
S6 = c(0.001, 0.094, 0.139, 0.016, 0.03, 0.001)),
class = "data.frame",
row.names = c("OTU1", "OTU2", "OTU3", "OTU4", "OTU5", "OTU6"))
> environment <- structure(list(category = structure(c(1L, 1L, 3L, 3L, 2L, 2L),
.Label = c("Leaf", "Root", "Soil"), class = "factor"),
season = structure(c(1L, 1L, 1L, 2L, 2L, 1L),
.Label = c("dry", "wet"), class = "factor")),
class = "data.frame",
row.names = c("S1", "S2", "S3", "S4", "S5", "S6"))
> pheatmap(matrix,
annotation_col = environment,
cluster_rows = TRUE,
cluster_cols = FALSE,
show_colnames = TRUE,
cluster_distance_rows = "euclidean",
clustering_method = "complete",
fontsize = 10,
fontsize_row = 10)
![Heatmap][1]
[1]: /media/images/07165394-b1d7-4707-8252-65bfd03a
|
biostars
|
{"uid": 9491979, "view_count": 1337, "vote_count": 1}
|
I am trying to understand what an objective function really is. Every sequence alignment method should have an objective function. When it comes to the needleman-wunsch algorithm, what is precisely the objective function? I know there is a dynamic-programming matrix that should be filled. At each cell (i,j) in the matrix, the value is the maximum of three things: value in cell (i,j-1) - gap penalty, value in cell (i-1,j) -gap penalty, value in cell (i-1,j-1)+substitution score. Is this what is called the objective function ?
|
I would consider the objective function to be the resulting scores of the paths through the dynamic-programming matrix. This is what's actually being optimized, after all. That also nicely matches the definition of an objective function, since each path score represents multiple comparison events summarized in a single real value.
|
biostars
|
{"uid": 138231, "view_count": 2495, "vote_count": 1}
|
<p>Hiiii....If anyone can please helo me how to convert fasta files into fastq using ubuntu....i shall be very thank ful....</p>
|
For those who may happen to reach this thread by way of search in future you can convert a fasta file to fastq format using `reformat.sh` from [BBMap][1] suite.
Please remember that the Q-scores created here are fake (example below sets Q-scores to 35 for all bases).
`reformat.sh in=test.fa out=fake.fq qfake=35`
[1]: https://sourceforge.net/projects/bbmap/
|
biostars
|
{"uid": 117676, "view_count": 28983, "vote_count": 2}
|
I would like to have the biotypes (like in ensembl transcripts) but for the NCBI refSeq downloaded from UCSC mysql. Which table should I join and which column should I use?
My current query without the biotype is:
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -u genome -D hg19 -N -A -e 'select bin,name,chrom,strand,txStart,txEnd,cdsStart,cdsEnd,name2 from refGene'
|
Technically the biotype is for a transcript, and not a gene. While in many cases the biotype of all transcripts for a gene will be the same, you get a few that aren't. That said I'm not sure off the top of my head if you can do a join within UCSC between the two tables. You might need to output two datasets (refseq and ensembl) and cross-correlate them yourself with a little script. You can output alternative IDs in both tables, and use whichever you prefer to link the two tables.
**Update**: This is a relatively step-by-step guide of how I generated a table linking ensembl Transcript IDs to RefSeq IDs:
UCSC Table Browser: https://genome.ucsc.edu/cgi-bin/hgTables
**Group**: Gene and Gene Predictions **Group**: Ensembl **Table**: ensGene
**Output format**: selected fields from primary and related tables
1. Click on get output
2. On next page under linked tables click the box beside ccdsInfo and then click allow selection from checked tables
3. More tables come up for linking click on ccds id under the CCDS table info fields. Also click on the table knownTo refseq and allow selection from checked tables again
4. Under known to refseq click both fields (primary id and value)
5. Click get output near the top of the page under the fields for the ensembl table
You'll end up with ensembl transcript IDs in the first column and a list of NM IDs in the final column. You can then process this however you like to get a mapping of refseq IDs to Ensembl. I didn't poke around enough to see if I could find a linked table to get biotype IDs, that may be easier to get from BioMart on the ensembl website itself. With those two files you should be able to parse them as tab delimited data and create a mapping file, associate biotypes, etc.with a fairly simple perl/python/scripting language of choice script.
|
biostars
|
{"uid": 151649, "view_count": 5231, "vote_count": 3}
|
There are many experiments where samples are stored in 384-well plates (or 96-well plates etc.) and a measurement is made on each sample. Typical technical biases may affect spatial regions of the plate, for instance the borders (evaporation, ...), or large bands when the thermocycling (in PCR) is preformed by separate independent controllers, etc. In some more complicated experiments, each well may contain a NGS library, for which multiple quality control scores can be computed.
I searched for `R` functions for pretty printing of values arranged in the geometry of a multiwell plate and I was surprised that I did not find anything obvious. Perhaps because the solution is too trivial ? Still, I would be happy to use a well-thought packaged function instead of a quick-and-dirty ad-hoc home-made wheel reinvention.
Here is an example below. The problems with this script are that 1) it requires flipping some levels that should stay as they are otherwise and 2) SVG or PDF version had a very ugly appearance as each square was strongly smoothed...
*My question is whether there are good packaged tools (in R) to do such plots and more operations on representations of multiwell plates.*
plate <- data.frame( Row = rep(LETTERS[1:16], 24)
, Col = unlist(lapply(1:24, rep, 16)))
plate$Row <- factor(plate$Row, levels=rev(levels(plate$Row)))
set.seed(1)
plate[001:096, "val"] <- rpois(96,10)
plate[097:384, "val"] <- rpois(96, 6)
png("plate.png", h=400,w=600)
ggplot2::ggplot(plate, ggplot2::aes(Col, Row, fill=val)) + ggplot2::geom_raster()
dev.off()
![384-well plate with random values][1]
[1]: https://gist.githubusercontent.com/charles-plessy/6325a878429fef8aae6d9ed25f0054ef/raw/f56cb303524f8c943d86a62583cadea17ea4959f/plate.png
|
I made an R package for plotting platemaps with a few utility functions. Mainly just a wrapper round some ggplot2 code, with a few functions for converting between formats (matrix <-> Well_ID+value).
https://github.com/swarchal/platetools
|
biostars
|
{"uid": 184422, "view_count": 4456, "vote_count": 5}
|
I would like to extract VCF subset with only those variants that are present in one particular sample. E.g. i have three sample VCF with ten variants. Only one variant has been detected in the first sample, so i would like to subset VCF so that only this variant is kept.
Pseudo code would be something like:
bcftools query -f'%CHROM:%POS %INFO [%GT]\n' -i'GT="alt in sample1"' file.vcf
The desired output is VCF with three samples but only variants present in one of the samples, in this case `sample1`
|
Alternative solution is to use `bcftools +split` plugin, e.g.:
bcftools +split file.vcf -Ob -o testDir -i'GT="alt"'
|
biostars
|
{"uid": 9532917, "view_count": 610, "vote_count": 1}
|
So, I have a directory:
Pipeline
- database: contains the custom blast database
- scripts
- genomes
- output
I want my local blast.sh script ( in the script folder) to take all the *.fna of the genomes folder and put results in the output folder.
So i specified the following:
for F in ../genomes/*.fna
do
blastn -query $F -db ../database/blastdb/dbGOI.fasta -outfmt 5 -out ../output/${F%.*}.xml
done
But when I run this, all of my output .xml files are in the genome folder and I do not know why since I specified that in the code.
Am I missing something?
|
So, since that seemed to be a bug, I used the following workaround:
blastn -query $F -db ../database/blastdb/dbGOI.fasta -outfmt 5 >> ../output/results.xml
since I used cat to put all theoutput files together, I save a line of code.
|
biostars
|
{"uid": 308294, "view_count": 1714, "vote_count": 1}
|
<p>I want to have a bigwig file converted into gff after having the genome coordinates and genome annotation files converted from Hg19 to Hg18. One way, would be to convert bigwig into BED, use the liftover tool and then have the BED file converted into gff. Could someone please suggest a method to convert bigwig to BED, nothing available on the net.</p>
|
<p><a href='http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/bigWigToBedGraph'>bigWigToBedGraph</a> might be what you're looking for.</p>
<p><a href='http://genome.ucsc.edu/goldenPath/help/bedgraph.html'>bedgraph format</a></p>
|
biostars
|
{"uid": 71692, "view_count": 42589, "vote_count": 5}
|
I'm writing my RNA-seq pipeline by Snakemake.when I was writing the last part"rule fpkm" which is calculate fpkm value from bam files. I got the error:
MissingInputException in line 3 of /root/s/r/snakemake/my_rnaseq_data/Snakefile:
Missing input files for rule all:
05_ft/wt2_transcript.gtf
05_ft/wt1_transcript.gtf
05_ft/wt2_gene.gtf
05_ft/epcr1_gene.gtf
05_ft/wt1_gene.gtf
05_ft/epcr2_transcript.gtf
05_ft/epcr1_transcript.gtf
05_ft/epcr2_gene.gtf
Here is my Snakefile:
SBT=["wt1","wt2","epcr1","epcr2"]
rule all:
input:
expand("02_clean/{nico}_1.paired.fq", nico=SBT),
expand("02_clean/{nico}_2.paired.fq", nico=SBT),
expand("03_align/{nico}.bam", nico=SBT),
expand("04_exp/{nico}_count.txt", nico=SBT),
expand("05_ft/{nico}_gene.gtf", nico=SBT),
expand("05_ft/{nico}_transcript.gtf", nico=SBT)
rule trim:
input:
"01_raw/{nico}_1.fastq",
"01_raw/{nico}_2.fastq"
output:
"02_clean/{nico}_1.paired.fq.gz",
"02_clean/{nico}_1.unpaired.fq.gz",
"02_clean/{nico}_2.paired.fq.gz",
"02_clean/{nico}_2.unpaired.fq.gz",
shell:
"java -jar /software/Trimmomatic-0.36/trimmomatic-0.36.jar PE -threads 16 {input[0]} {input[1]} {output[0]} {output[1]} {output[2]} {output[3]} ILLUMINACLIP:/software/Trimmomatic-0.36/adapters/TruSeq3-PE-2.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36 &"
rule gzip:
input:
"02_clean/{nico}_1.paired.fq.gz",
"02_clean/{nico}_2.paired.fq.gz"
output:
"02_clean/{nico}_1.paired.fq",
"02_clean/{nico}_2.paired.fq"
run:
shell("gzip -d {input[0]} > {output[0]}")
shell("gzip -d {input[1]} > {output[1]}")
rule map:
input:
"02_clean/{nico}_1.paired.fq",
"02_clean/{nico}_2.paired.fq"
output:
"03_align/{nico}.sam"
log:
"logs/map/{nico}.log"
threads: 40
shell:
"hisat2 -p 20 --dta -x /root/s/r/p/A_th/WT-Al_VS_WT-CK/index/tair10 -1 {input[0]} -2 {input[1]} -S {output} >{log} 2>&1 &"
rule sort2bam:
input:
"03_align/{nico}.sam"
output:
"03_align/{nico}.bam"
threads:30
shell:
"samtools sort -@ 20 -m 20G -o {output} {input} "
rule count:
input:
"03_align/{nico}.bam"
output:
"04_exp/{nico}_count.txt"
shell:
"featureCounts -T 10 -p -t exon -g gene_id -a /root/s/r/p/A_th/WT-Al_VS_WT-CK/genome/tair10.gtf -o {output} {input}"
rule fpkm:
input:
"03_align/{nico}.bam"
output:
"05_ft/{nico}_gene.gtf"
"05_ft/{nico}_transcript.gtf"
shell:
"stringtie -e -p 30 -G /root/s/r/p/A_th/WT-Al_VS_WT-CK/index/tair10 -A {output[0]} -o {output[1]} {input}"
Here is my partial directory:
|-- 03_align
| |-- epcr1.bam
| |-- epcr1.sam
| |-- epcr2.bam
| |-- epcr2.sam
| |-- wt1.bam
| |-- wt1.sam
| |-- wt2.bam
| `-- wt2.sam
|-- 04_exp
And the bam files are existed as I run the Snakefile before I add the 'rule fpkm' part.
So before the last part ,it goes fine. But when I add 'rule fpkm' it report error like I describe above.Any ideals are welcomed. Thank you!
|
I know the solution, add `,` at the tail of `05_ft/{nico}_gene.gtf`
|
biostars
|
{"uid": 377013, "view_count": 4301, "vote_count": 1}
|
Is there a ready-made command-line program that can output sequence lengths from a fasta file? Like so:
```
YKR054C,4092
YLR106C,4910
...
```
I've seen [examples][1] of people trying to roll their own using `awk`, but I would rather not do that if I can avoid it. Between Emboss, Biopython, Bioperl, etc there must be something that can do this, right? What I'm looking for would be the equivalent of what `blast_formatter` can do for blast hits, something that can extract simple information that's already there in a format specified by user. Thank you.
[1]: http://stackoverflow.com/questions/23992646/sequence-length-of-fasta-file
|
Heng Li's [bioawk][1] might be a good compromise between the simplicity of awk and readability of programming languages.
bioawk -c fastx '{ print $name, length($seq) }' < sequences.fa
[1]: https://github.com/lh3/bioawk
|
biostars
|
{"uid": 118954, "view_count": 57304, "vote_count": 5}
|
I am supposed to analyze some metabarcoding reads. However, the forward and reverse reads are unable to be merged due to lack of overlap. I was informed that this is because the sequence was too long, so the forward and reverse sequences couldn't extend far enough to overlap adequately.
My question is, what would be the problem of using the forward reads alone, as if they were single-end? My first thought is that they are too short to be a legitimate barcode sequence for identifying taxa. But I'm not sure. It's COI. I gather from Meusnier et al. 2008 that a 95% success rate of species identification was obtained with 250-bp mini barcodes. My forward sequences are that long. But this region by itself has not been tested for specificity. How does this impact its reliability?
Thank you for your input.
|
Using just the forward read is a good idea. Just watch out that depending on your library preparation method read 1 might not correspond to the forward direction but forward and reverse is mixes ~50:50. Here trimming the forward primer on read one and two, using e.g. Cutadapt and then reverse complementing the read 2 can help.
If you are concerned about the reliability of the identification with just one direction, you could also analyze read 2 the same way and compare results, or fill in the missing basses in between the reads with Ns to obtain a "full-length sequence". If you do so, however, make sure to apply strict filtering afterward to discard reads of poor quality especially read 2 ends. You can also concatenate sequences, and "reformat" the sequences in your reference database to match these. But this is maybe a bit much effort, using only forward direction should be sufficient in most cases my opinion =)
|
biostars
|
{"uid": 311570, "view_count": 1270, "vote_count": 1}
|
<p>I have five exomes(in bam format), each a different sample, that I would like to merge into one bam. None of the bam have @RG's in the headers, I am assuming I must add this information first? I also assume this is how I can pull apart the variant information after I processes it with GATK? The Picard documentation states you must pass in a value for UNMAPPED_BAM (definition Original SAM or BAM file of unmapped reads, which must be in queryname order. Required.) I don't undstand what this file is? When I did my alignment should I have dumped the unaligned reads to a file? If so can merge them in a way that does not require unaligned reads to be present. </p>
|
<p>I've successfully used the following to merge multiple bam files:</p>
<pre><code>samtools merge merged.bam in.1.bam in.2.bam ...
</code></pre>
<p>Although they had @SQs, none had @RGs. Do you have no headers or just no @RGs?</p>
|
biostars
|
{"uid": 16242, "view_count": 76003, "vote_count": 9}
|
Hello,
I am reading the STAR manual and I came across the publication for STAR-fusion. I could not understand how different they are from each other. Could someone help me understand the difference?
Thank you in advance.
|
STAR aligner is a splice aware aligner that aligns junction reads using a guide GTF. [STAR-fusion][1] allows identification of [fusion transcripts][2]. In many cases you get fusion transcripts due to chromosomal translocation (cancer) or trans-splicing etc. Other splice aware aligners ([Tophat-Fusion][3]) also have fusion engine for same purpose.
[1]: https://github.com/STAR-Fusion/STAR-Fusion/wiki
[2]: https://en.wikipedia.org/wiki/Fusion_transcript
[3]: http://ccb.jhu.edu/software/tophat/fusion_index.shtml
|
biostars
|
{"uid": 273301, "view_count": 2738, "vote_count": 1}
|
I'm trying to understand the clinical data for the TCGA melanoma (`nationwidechildrens.org_clinical_patient_skcm.txt`). From sources like https://cancerstaging.org/references-tools/quickreferences/Documents/MelanomaMedium.pdf, stage 0 (melanoma in situ, also graded Tis) is inherently not metastatic and that is why it is labeled stage 0.
But in the clinical data (partially copied below), samples that are labeled Stage 0 / Tis with no regional or distant metastases (N0 and M0), are also labeled as distant metastases. Also the patients are dead, presumably of their metastatic melanomas. This seems impossible. Maybe it was initially diagnosed as stage 0 and somehow became metastatic anyway? --but then you would not expect that to be the annotation of that tumor data in the clinical file. If I want to find all of the clinically low stage tumors, what would be the best way to do that, if not by using this field? Any ideas? Thank you!
```
bcr_patient_barcode tumor_status vital_status death_days_to primary_melanoma_known_dx primary_multiple_at_dx primary_at_dx_count breslow_thickness_at_diagnosis clark_level_at_diagnosis primary_melanoma_tumor_ulceration ajcc_tumor_pathologic_pt ajcc_nodes_pathologic_pn ajcc_metastasis_pathologic_pm ldh_level ajcc_pathologic_tumor_stage submitted_tumor_site submitted_tumor_site metastatic_tumor_site primary_melanoma_skin_type
TCGA-EE-A20C WITH TUMOR Dead 4601 YES NO [Not Available] [Not Available] I [Unknown] Tis N0 M0 [Not Available] Stage 0 Extremities Distant Metastasis Right back Non-glabrous skin
TCGA-ER-A2NE WITH TUMOR Dead 613 YES NO [Not Available] [Not Available] [Not Available] [Not Available] Tis N0 M0 [Not Available] Stage 0 Extremities Distant Metastasis Ileum (serosa) [Not Available]
TCGA-D3-A8GR WITH TUMOR Dead 3943 YES NO [Not Available] 0.01 I [Unknown] Tis N0 M0 [Not Available] Stage 0 Extremities Distant Metastasis Small Intestine [Not Available]
```
|
I think I figured it out. Emailing with the TCGA helpdesk helped a bit. There's some helpful info on [the corresponding enrollment form][1]
And most of those fields pertain to the patient's primary diagnosis. Only the fields below actually pertain to the tumor specimen (plus a few other fields having to do with therapies that would lead to exclusion of the tumor)
```
submitted_tumor_dx_days_to submitted_tumor_site metastatic_tumor_site
days_to_submitted_specimen_dx tumor_tissue_site distant_metastasis_anatomic_site
CDE_ID:3430945 CDE_ID:3427536 CDE_ID:2961431
```
So, my interpretation of patient TCGA-ER-A2NE (from my original question), is: The patient originally presented in 2007 with a melanoma in situ with no metastasis, and that original melanoma was located on the extremities. 567 days later the patient had a metastasis in the ileum. This metastasis in the ileum is the sample that was submitted to TCGA. The patient died of the metastasis 613 days after diagnosis.
Therefore, what I was hoping to do (use the clinical data to find the lower grade/stage tumors) is only somewhat possible. Instead I used the TCGA barcodes to identify primary & metastasis. Hope this helps someone.
[1] http://www.nationwidechildrens.org/melanoma-enrollment-form
|
biostars
|
{"uid": 124529, "view_count": 3967, "vote_count": 3}
|
Hi,
Hope someone may be able to point me in the right direction!
I've generated some polygenic risk scores for schizophrenia in a cohort of individuals with borderline intellectual disability. Trying to figure out a way to validate the scores I'm getting out of PRSice. Is there a way to do this?
My current results (with --all-score) look something like this:
https://ibb.co/jv9YQP5
(sorry couldn't place the table here in an easily legible format)
There are some patterns in my results, with some individuals having identical scores at particular p-values (is this just due to the stats involved in generating the scores?), and the scores are pretty low (clustering around 0) with some changing from positive to negative depending on p-value threshold. Is this typical of polygenic risk scores?
I've followed Marees et al 2018 (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6001694/) and Sam Choi's tutorail (https://choishingwan.github.io/PRS-Tutorial/) to generate this, but I'm thinking I may have made errors somewhere along the line and would like to check my results somehow!
Any advice would be much appreciated!
|
Your sample size is simply too small. That will usually not give you any reasonable result. I suspect that as you've less than 100 samples, the clumping LD varies quite a lot, lead to more variants being removed than normally would (which lead to the small variant count). One way to get around that will be to use a reference panel (e.g. 1000 genome) which has a larger sample size. Though at the end of the day, with only 100 samples, I don't expect you to get any meaningful results.
Given there are only 265 variants after clumping, it is very possible that you'd only have one or two SNP included in a particular threshold, which can then lead to the identical PRS. So I am not too surprise about your results.
|
biostars
|
{"uid": 446173, "view_count": 1819, "vote_count": 1}
|
we did a 16S RNA analysis using MiSeq kit version 3. This kit makes paired-end reads with a size of 300pb. By merging both reads, we can cover 535 pb of region V3-V5.
As you can see in the following plot, qualities of reads are really bad after the nucleotid 250.
Is it normal ? Perhaps the strategy prefers reads lenghs to the quality ? Did you get something similiar with the same kit ?
![V3-V5 region][2]
![fastqt quality plot][1]
After merging with Flash
![After merging][3]
[1]: https://framapic.org/7luICTwCp8FU/dyD2VMKC7cXW.png
[2]: https://framapic.org/TASsvk65DaIc/xpkU8WlSSVWX.png
[3]: https://framapic.org/JNjXjmVbVhHm/1oVAPSZiYRSu.png
|
As pointed in the comments, Illumina's problems with MiSeq v3 kit and 2x300bp are known and old, see for example [here][1] and [here][2]. Informally, (at least some) Illumina technicians will tell you to stay with 2x250bp, I am not sure if someone at Illumina said so on record.
[1]: http://blog.mothur.org/2014/09/11/Why-such-a-large-distance-matrix/
[2]: http://omicsomics.blogspot.com.br/2015/12/loose-2015-threads-1-miseq-2x300-issues.html
|
biostars
|
{"uid": 249144, "view_count": 4668, "vote_count": 2}
|
Hi, I want to convert my text file to a GTF, GFF3 or BED file. My file is organized like that.
This is a list of operons downloaded from RegulonDB, but I need to convert it in one of this format in order to visualize them in IGV.
Column Names:
1) OPERON_ID
2) OPERON_NAME
3) FIRSTGENEPOSLEFT
4) LASTGENEPOSRIGHT
5) REGULATIONPOSLEFT
6) REGULATIONPOSRIGHT
7) OPERON_STRAND
8) KEY_ID_ORG
ECK120007527 ycaM 946452 947882 946159 947882 forward ECK12
ECK120014360 astCADBE 1823979 1830006 1823979 1830351 reverse ECK12
ECK120014361 pyrH 191855 192580 191718 192580 forward ECK12
ECK120014362 nrdHIEF 2798745 2802483 2798457 2802483 forward ECK12
ECK120014363 cpxP 4103843 4104343 4103749 4104402 forward ECK12
I do not know if there is a way to directly convert my file in one of these formats. Otherwise , what is the command to get the correct columns ?
Thank you.
|
Hi bonardi.franck,
All the files you mentioned are text-files with a certain formal definition. See here the [bed][1], the [gff3][2], and [gtf][3] descriptions.
For your purpose, it seems to me it would be best to parse your data into a bed format. You can use FIRSTGENEPOSLEFT and LASTGENEPOSRIGHT to define your region (fields 2 and 3 ) and the REGULATIONPOSLEFT and REGULATIONPOSRIGHT as thick start, resp end. For the name, you can choose the OPERON_ID, the OPERON_NAME or a mixture of both. The OPERON_STRAND needs to be converted into + or -. Still you need the chromosome name (I assume KEY_ID_ORG is this here).
You can use for instance awk or perl to reformat each line of your textfile, that you have the necessary structure. It looks something like `awk '{if(match($7,/forward/)){s="+"}else{s="-"} ; print $8"\t"$3"\t"$4"\t"$1"\t"s"\t"$5"\t"$6 }' mytext.txt > myoperons.bed`
Cheers,
Michael
[1]: http://bedtools.readthedocs.org/en/latest/content/general-usage.html
[2]: http://www.sequenceontology.org/gff3.shtml
[3]: http://mblab.wustl.edu/GTF2.html
|
biostars
|
{"uid": 182333, "view_count": 5953, "vote_count": 1}
|
Hey guys,
I am going to aligning reads from GSE35641 (http://www.ncbi.nlm.nih.gov/Traces/sra/?view=search_seq_name&exp=SRX119208&run=&m=search&s=seq), on ecoli reference genome (NC_000913). There are 6 sra files in GEO which the least size is more than 2G. Do you know any way to download the files faster? I need many hours to download a file of them in fasta format
Thank you biostars
|
Look at using [aspera from the command line][1] or, if you are using R, as described in sections 3.5 and 3.6 of [the SRAdb vignette][2].
[1]: http://www.ncbi.nlm.nih.gov/books/NBK158899/
[2]: http://www.bioconductor.org/packages/release/bioc/vignettes/SRAdb/inst/doc/SRAdb.pdf
|
biostars
|
{"uid": 142721, "view_count": 2044, "vote_count": 2}
|
Hi,
I have two files with about 4 fasta sequences each in the PHYLIP format for Da/Ds (Ka/Ks) comparison. After a search on the net, I found that the best software to do so is PAML and it requires a control file and 2 input files. For the tree input, I used PHYML which accepts PHYLIP file inputs and gives NEWICK format outputs. However I am unsure as to how to get the sequence file. I tried the sequential format but it gives me the "Error in sequence data file" error.
[This][1] is my control file. [Here][2] is my sequence file and [here][3] is my tree file.
Could I get some advice on what is wrong with my input file please. Also, this is just one set of the sequences which I wanted to compare. How do I compare two sets of sequences for the Da/Ds values. I know that this might be basic so thank you for your patience.
[1]: https://www.dropbox.com/s/dupmdmufapmfzdk/codeml.ctl?dl=0
[2]: https://www.dropbox.com/s/mwr05pxvlzvk9ea/tm-lrr.txt?dl=0
[3]: https://www.dropbox.com/s/e6hi4pirbr8goho/tmphy_phy_phyml_tree.txt?dl=0
|
I don't think your sequence file is in correct format and does not look like a multiple alignment. You need a multiple sequence alignment as input. You can use the online tools (either Readseq or Built-in converter) at [Phylogeny.fr][1] website to check if your sequence file is in correct format (by trying to convert to other format).
The sequences in your file are also not of same length. If the 'cleandata' option is set to 1 in the .ctl file (which is the default), PAML will remove any sites with gaps in at least one sequence.
From the [PAML User Guide][2] (Page 11):
The way that ambiguity characters and alignment gaps are treated in baseml and codeml depends on the variable `cleandata` in the control file. In the maximum likelihood analysis, sites at which at least one sequence involves an ambiguity character are removed from all sequences before analysis if `cleandata` = 1, while if `cleandata` = 0, both ambiguity characters and alignment gaps are treated as ambiguity characters. In the pairwise distance calculation (the lower-diagonal distance matrix in the output), `cleandata` = 1 means "complete deletion", with all sites involving ambiguity characters and alignment gaps removed from all sequences, while `cleandata` = 0 means "pairwise deletion", with only sites which have missing characters in the pair removed.
[1]: http://phylogeny.lirmm.fr/phylo_cgi/programs.cgi
[2]: http://abacus.gene.ucl.ac.uk/software/pamlDOC.pdf
|
biostars
|
{"uid": 119710, "view_count": 14813, "vote_count": 1}
|
The lastz command will look like:
lastz reference.fasta sample.fasta --ambiguous=IUPAC --format=GENERAL > output.fasta
I need to run lastz once for every sample file, because each sample file has to be compared to its own individual reference (I have one reference for each sample).
I'm using find to get all of my 'sample' files, and will do the same for the reference files.
find . -type f -name 'sample.fasta' -not -path "*/temp/*"
The question is, how do I associate each sample file with each reference file, taking as input the output of the find command? Or is there a better way?
|
$ tree .
.
├── a
│ ├── reference.fa
│ └── sample.fa
├── b
│ ├── reference.fa
│ └── sample.fa
└── c
├── reference.fa
└── sample.fa
3 directories, 6 files
using parallel (remove dry-run option to execute the code):
$ ls -d */ | parallel --dry-run 'lastz ./{}reference.fa ./{}sample.fa --ambiguous=IUPAC --format=GENERAL > ./{}output.fa'
commands to be executed (i.e dry-run of code):
lastz ./a/reference.fa ./a/sample.fa --ambiguous=IUPAC --format=GENERAL > ./a/output.fa
lastz ./b/reference.fa ./b/sample.fa --ambiguous=IUPAC --format=GENERAL > ./b/output.fa
lastz ./c/reference.fa ./c/sample.fa --ambiguous=IUPAC --format=GENERAL > ./c/output.fa
|
biostars
|
{"uid": 291578, "view_count": 2118, "vote_count": 1}
|
Hi,
I am generating bcf files from vcf. When indexing using bcftools the default indiexing is .csi however I also have tabix (generates .tbi index files) installed on my system hence I can opt for either. I'd just like to have a brief comparison between the two indexing formats in order to know which one to choose.
Thank you,
|
<p>Hello ThePlaintiff!</p>
<p>Questions similar to yours can already be found at:</p>
<ul>
<li> <a href="/p/111984/">samtools 1.0 'index' : CSI index vs BAI index ?</a></li>
</ul>
<p>
We have closed your question to allow us to keep similar content in the same thread.
</p>
<p>
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
</p>
<p>Cheers!</p>
|
biostars
|
{"uid": 362556, "view_count": 4280, "vote_count": 3}
|
I have 21 bacterial isolates from termite guts and I want to determine the completness of the genomes. Which tool between BUSCO and CheckM is best to do this?
|
I use CheckM and haven't tried BUSCO in couple of years, so take that into account when considering my advice.
My impression was that BUSCO was too stringent in how it defined completeness and that they didn't use enough reference groups. That might have changed with version 4 of BUSCO based on the increased number of taxonomic groups, but I have no first-hand experience with the latest release. I think CheckM is easy to install and its results are straightforward, though it does require large memory. It is also my impression that CheckM is more or less the standard for prokaryotes (does not work with eukaryotes), while BUSCO may be more useful for eukaryotes even though it works with both. In the long run, BUSCO might overtake CheckM because it is broader in scope and appears to be actively maintained.
|
biostars
|
{"uid": 433590, "view_count": 1654, "vote_count": 1}
|
I am in the typical situation that I need a resequencing pipeline (i.e., FastQC, read preprocessing, FastQC again, alignment with BWA, variant calling). I need to fulfill both the requirements of having a stable pipeline with stable tools for the standard stuff (e.g., both "single-donor WES variant calling", "trio WES variant calling", but also "tumor/normal WES variant calling with somatic filtration") but I sometimes need more specialized functionality or more extensive downstream analysis.
I want to use Docker for isolating my tools against the uncertain, changing, and sadly oftentimes unversioned world of Bioinformatics software (I'm looking at you, vt and vcflib, but I'm still very grateful that you are around). What would be your recommendation for a best practice here:
- one Docker image for everything, adding tools as I go
- one Docker image for each pipeline step (e.g. combining BWA-MEM, samtools, samblaster for the alignment so I can use piping in a front-end script)
- one Docker image for the standard stuff, then maybe some images for each additional step.
Does anyone know of a person/organization that has published their Dockerized pipeline stuff in a Blog post or elsewhere that goes beyond toy examples or "here is a Dockerfile for the tool that I wrote/published"?
Cheers!
|
Illumina Base Space actually uses it to run their cloud based pipeline with Docker tools. http://basespace.illumina.com They keep it down to tools level.
Docker was initially built and optimized to run "one" process efficiently. Therefore it is advisable to keep it down to tools level. Also, if you think about pipeline building, you probably want to have a Lego-like tool box and combine different workflows with different - often the same - tools.
As Illumina solved this, they have in each Docker container an input folder and an output folder, in Basespace you can actually publish your own tools as Docker container.
|
biostars
|
{"uid": 139326, "view_count": 5228, "vote_count": 11}
|
Hi, I have the gtf file for mouse, and I wanted to create bed files for the 5' and 3' UTRs using this gtf file ( I know there is method using the UCSC Table website, but I want to generate using the GTF file itself).
As far as I know, information about the UTR regions is not explicitly stated in the gtf file. So, what would be a good strategy to extract these bed files from the gtf file?
Thanks!
|
Another [option][1].
python extract_transcript_regions.py -i genes.gtf -o genes --gtf
now convert this blockbed (bed12) to bed6
cat genes_3utr.bed | bed12ToBed6 -i stdin -n > genes_3utr_bed6.bed
cat genes_5utr.bed | bed12ToBed6 -i stdin -n > genes_5utr_bed6.bed
[1]: https://github.com/stephenfloor/extract-transcript-regions
|
biostars
|
{"uid": 282458, "view_count": 8358, "vote_count": 3}
|
Hello
I want to parallelize a fastQC computation of a large fastq file.
I know that fastQC can be run on several files in parallel using the -t option, but I'm not sure if this will yield a correct result if I will split the file into several smaller files.
Is there any way to this?
Thanks in advance
Dolev Rahat
|
If you split the files into small parts then FastQC will run on each separately and the results are not combined.
As to an answer to your question - the problem (as always) is more complicated than it looks. In a perfect world splitting the file into random subsets would produce the similar results. But splitting into random subsets is not all that easy. In addition the way FastQC works is that it some operations will only collect information from the first 200K or so reads but will then track that information throughout the file.
Often and if the data is not skewed in particular ways you can get by analyzing a small subset of the file.
In other cases (as I have painfully learned myself) subsetting a dataset can produce reports that do not even remotely resemble the original data. But that had nothing to do with the way FastQC works.
Long story short I would run FastQC on all data then a subset of it - check if the library prep and the subject under study supports subsetting.
|
biostars
|
{"uid": 116897, "view_count": 6296, "vote_count": 1}
|
I have a combined fasta file with all my sequences. I want to print the ID lines and their DNA sequence that end in `.4`
So far I have `awk /'>*.4'/ {getline;print} combined.fasta` Which prints the sequences that I want, how do I get the ID lines as well?
|
Since you requested bash only:
#!/bin/bash
string="$2"
while read line ; do
if [[ ${line:0:1} == ">" ]] ; then
header="$line"
else
seq="$line"
if [[ "$header" == *"$string" ]]; then
echo -e "$header""\n""$seq"
fi
fi
done < $1
Put it in a script file and run it like:
$ bash parseheaders.sh seqs.fasta .4
Some of my own test data:
$ cat seqs.fasta
>tpg|Magnaporthiopsis_incrustans|JF414846
ACTGTAGTAGCTACGATCGATCAGATGATCACGTAGCATCGATCGATCATCGACTAGTAGATCACTCGACATAGATCCACATCAATAGATCATCATCATCATAATCGATCACTAGCAGC
>tpg|Pyricularia_pennisetigena|AB818016
GCAAGNTTCATGACGATGTAGAATGGCTTATCGAAGGGAGCAGGCCAGGGATTGAGGTCCGTCTCACGGGTTGGCTTCACTCCCCCACTGCCAGCCCTCTTGCTGCAACTCCACCAGAA
>tpg|Inocybe_sororia|EU525947
AACCANGCCGCGACGGCGGTGCGATCGGGAAACGCGGCGGTGGCGGAGGAATCGGCCATCCTTCACCATATCGGCCAAGGATTGTGGTTCCTGTAGGGCTCGCGCAGCCCAGGACGCGC
$ bash parseheaders.sh seqs.fasta 947
>tpg|Inocybe_sororia|EU525947
AACCANGCCGCGACGGCGGTGCGATCGGGAAACGCGGCGGTGGCGGAGGAATCGGCCATCCTTCACCATATCGGCCAAGGATTGTGGTTCCTGTAGGGCTCGCGCAGCCCAGGACGCGC
|
biostars
|
{"uid": 286130, "view_count": 2574, "vote_count": 2}
|
Hi group,
Just a quick question, how to I properly use the fastq command in samtools 1.3? According to the documentation I should be doing this:
samtools fastq -On -s ion36_nohost.fastq ion36_nohost.bam
but the result is this:
[M::bam2fq_mainloop_singletontrack] discarded 0 singletons
[M::bam2fq_mainloop_singletontrack] processed 0 reads
I'm trying to get the unmapped reads. My bam file does contain the reads in question but I'm doing something wrong since they switched to `fastq` from `bam2fq`
Any idea?
|
I must have misunderstood the docs becasue this was at the top and works
samtools fastq input.bam > output.fastq
but the detail doc is different here:
> samtools fastq [options] in.bam samtools fasta [options] in.bam
>
> Converts a BAM or CRAM into either FASTQ or FASTA format depending on
> the command invoked.
>
> OPTIONS:
>
> -n By default, either '/1' or '/2' is added to the end of read names where the corresponding BAM_READ1 or BAM_READ2 flag is set. Using -n
> causes read names to be left as they are.
>
> -O Use quality values from OQ tags in preference to standard quality string if available.
>
> -s FILE Write singleton reads in FASTQ format to FILE instead of outputting them.
>
> -t Copy RG, BC and QT tags to the FASTQ header line, if they exist.
>
> -1 FILE Write reads with the BAM_READ1 flag set to FILE instead of outputting them.
>
> -2 FILE Write reads with the BAM_READ2 flag set to FILE instead of outputting them.
>
> -0 FILE Write reads with both or neither of the BAM_READ1 and BAM_READ2 flags set to FILE instead of outputting them.
>
> -f INT Only output alignments with all bits set in INT present in the FLAG field. INT can be specified in hex by beginning with `0x' (i.e.
> /^0x[0-9A-F]+/) or in octal by beginning with `0' (i.e. /^0[0-7]+/)
> [0].
>
> -F INT Do not output alignments with any bits set in INT present in the FLAG field. INT can be specified in hex by beginning with `0x'
> (i.e. /^0x[0-9A-F]+/) or in octal by beginning with `0' (i.e.
> /^0[0-7]+/) [0].
|
biostars
|
{"uid": 184134, "view_count": 20501, "vote_count": 2}
|
HI,
I need some help to start working with SAMtools. As a beginner with biostatistics background, it is my first time that I'm using Linux Ubuntu (I have installed it on my windows by making a machine on VMware for illustration purpose). Now I'm going to know how to work with SAMtools to carry out basic commands such as:
1- importing bam/sam files into samtools
2- Viewing the data
3- Sorting bam files
4. Calling variants
I have already searched on the internet and have found some tutorials such as http://www.htslib.org/doc/samtools.html , but I don't have any idea what those commands are!
could anybody please tell me where I can find a step by step tutorial for a beginner who even doesn't know how to read such commands?
If I am right, I should run samtools on terminal... by using the commands : "sudo apt-get install samtools" and then writing "samtools", I think I have run samtools but how should I write the commands in samtools on terminal?
I would also be grateful if someone tells me where I can find some low sized bam files to test samtools.
Thanks a lot!
|
Spend some time here learning the basics of [UNIX][1].
<br>
You can also take a look at the online materials for a NGS data analysis course that can be found [here][2]. This would give you an overall idea of steps you would need to learn and the materials for that.
[1]: http://korflab.ucdavis.edu/Unix_and_Perl/current.html#part1
[2]: http://angus.readthedocs.org/en/2014/
|
biostars
|
{"uid": 181337, "view_count": 8280, "vote_count": 3}
|
Dear All,
I am searching for human 28S, 18S, 5.8S and 5S rRNA (RNA28S, RNA18S, RNA5-8S and RNA5S genes) and also 12S and 16S mitochondrial rRNA (MT-RNR1 and MT-RNR2) in human_genes.gtf file from UCSC.
I am unable to find these genes(RNA28S, RNA18S, RNA5-8S, RNA5S, MT-RNR1 and MT-RNR2 genes) in `human_genes.gtf` file. I am looking at `gene_id` or `gene_name` in gtf file.
How do I check these genes in gtf file or in any other resources.
Is it saved in some other name?
|
<p>You can find 5S, 5.8S and MT_rRNA in the Ensembl/Gencode files. The others aren't in the reference genome (they're on an unplaced contig). If you need the sequences then you can <a href="http://www.ncbi.nlm.nih.gov/gene/?term=45S+human">get them from NCBI</a> (the ones not in the reference genome come from 45S).</p>
|
biostars
|
{"uid": 162698, "view_count": 4822, "vote_count": 1}
|
Hi,
I want to extract reads from bam file using Samtools view from multiple regions.The regions I have are present in the VCF file,which I want to use.So there are not a small number of regions.Is there any way to do this in Samtools view.
for e.g inputting a file in some format in Samtools view?
Thanks
|
<p>Hello Ron!</p>
<p>Questions similar to yours can already be found at:</p>
<ul>
<li> <a href="/p/49306/">Samtools And Region List</a></li>
</ul>
<p>
We have closed your question to allow us to keep similar content in the same thread.
</p>
<p>
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
</p>
<p>Cheers!</p>
PS: duplicate of "Samtools And Region List"
|
biostars
|
{"uid": 97953, "view_count": 8983, "vote_count": 1}
|
Hi all ...
I'm using Biopython 3.4.1 with Blast 2.2.29 and I'm trying to get the query coverage of some blast search beside the default report info in tabular format using `-outfmt 6` as following :
comline=NcbiblastxCommandline(cmd='blastn',query="A.fasta",db="B.db",evalue=0.001,outfmt='6 qcovs',out="result.txt")
But it throws the following error:
Error: Too many positional arguments (1), the offending value: qcovs
I know it seems a very basic question ,but it's seriously driving me crazy ,since I spent two days trying to figure out the solution for this error and nothing seems to fix it !!
Some threads have addressed this issue and suggested to rewrite the command by hand instead of copying and pasting ... I did rewrite it by hand like thousand times and the error pertains .
Also, I have tried to run it from the Command Prompt cmd and again it threw the same error!!
Is there anyway to get around this problem?
Many thanks in advance
|
Did you try `outfmt='"6 qcovs"'`? The command string needs to literally contain these quotes, such that the command line looks like:
blastn -outfmt "6 qcovs" ...
|
biostars
|
{"uid": 121033, "view_count": 7917, "vote_count": 2}
|
Hi,
I am attempting to reanalyze some old data. Recently, an updated genome was released for the organism I work with. I had to map the reads to the new genome and what not. So what I have now is a bam file but now I want to do some variant calling so I can generate a vcf.
I know there is a lot of programs out there to do this but I am attempting to find the best one. I have tried using Platypus but the vcf file that it generates never contains any genome data. That is probably my fault but I can't seem to figure it out and there isn't much support. I tried VarDict but when I go to look at the vcf file, I get an error of "failure to parse tbx_vcf". I can really seem to find why I am getting that error. I have tried Freebayes and that has worked for me, but I have an issue with indels. Freebayes seems to call SNPs instead of acknowledging indels. I know there is GATK, but it seem like such a tedious piece of software. It looks like you have to go through 15 steps to just get anything worthwhile. I could be looking at the wrong examples. What I have notice about GATK is they try to make it so simple that it ends up just making things complicated.
Could anyone maybe give some suggestions or maybe some insight? Any help is very appreciated
Thanks!!
|
**Edit September 10, 2019:**
----
Although I have used samtools / bcftools mpileup, I have doubts surrounding its false positive rate; although, this can be controlled by setting a minimum *total* position read depth for each variant call (e.g. 30 reads). mpileup is neither fine-tuned to identify indels. Were I to implement a clinical pipeline in the future for calling germline variants, I would likely run both GATK and the method described below with mpileup, and then cross compare.
-----------------
------------
**Original answer**
----
While the GATK is popular, from my experience from analysing both clinical and research NGS data, GATK is *not* the most sensitive for detecting germline single nucleotide variants (SNVs). Sensitivity here is gauged by comparing NGS results to those of Sanger sequencing.
As you've mentioned, there are many variant callers out there and each has advantages, including the GATK. A fool would be the person who would come here and say that this or that particular program / pipeline is the best, as they are each good in different scenarios.
My 'go to' pipeline is the 'old faithful':
1. *BWA mem* for alignment (if read lengths > 70bp)
2. Remove low MAPQ reads
3. Mark and remove PCR / optical duplicates
4. Produce random BAM subsets per sample (usually 3 subsets at 25%,
50%, and 75% 'randomly' selected reads)
5. Call variants with *BCFtools mpileup* (main BAM and 3 subsets
together) piped into *BCFtools call*
The final command would be something like:
bcftools mpileup \
--redo-BAQ \
--min-BQ 30 \
--per-sample-mF \
--output-tags DP,AD \
-f "${Ref_FASTA}" \
--BCF Full.bam 75pcReads.bam 50pcReads.bam 25pcReads.bam | \
bcftools call \
--multiallelic-caller \
--variants-only \
-Ob > Variants.bcf
This has greater sensitivity for ***SNVs*** when compared to other pipelines that I've tested, which includes GATK and Illumina's BaseSpace pipeline. Granted, there are many programs and pipelines out there, and one would ideally have to test all of them, and on an expanded number of samples.
For somatic variant calling, I use Lancet.
Kevin
|
biostars
|
{"uid": 316574, "view_count": 13338, "vote_count": 9}
|
New to R. Recently working through an [ATAC-seq workshow in R][1].
In Section 5.1 of where I call the makeGRangesFromDataFrame function I get the following error -
> atac_esca.gr <- makeGRangesFromDataFrame(atac_esca,keep.extra.columns = T)
Error in makeGRangesFromDataFrame(atac_esca, keep.extra.columns = T) : could not find function "makeGRangesFromDataFrame"
I had previously installed the GenomicRanges package and I tried again. No joy. So I attached the package `require(GenomicRanges)` and now when I receive the following error when I go to repeat the same call -
> atac_esca.gr <- makeGRangesFromDataFrame(atac_esca,keep.extra.columns = T)
Error in inherits(object, class2) : 'what' must be a character vector
[Edit]:
> dput(head(atac_esca,10))
structure(list(seqnames = c("chr1", "chr1", "chr1", "chr1", "chr1",
"chr1", "chr1", "chr1", "chr1", "chr1"), start = c(1290095, 1291115,
1291753, 1440824, 1630188, 2030218, 2184484, 2185113, 2185905,
2186860), end = c(1290596, 1291616, 1292254, 1441325, 1630689,
2030719, 2184985, 2185614, 2186406, 2187361), name = c("ESCA_107",
"ESCA_108", "ESCA_109", "ESCA_160", "ESCA_179", "ESCA_341", "ESCA_539",
"ESCA_540", "ESCA_541", "ESCA_542"), score = c(2.46437811814343,
2.58792851900195, 7.57996223017863, 4.46727398384637, 20.6213237496952,
15.5725811237533, 19.2854359599157, 11.1907656456091, 22.2148888990001,
22.8844119795596), annotation = c("3' UTR", "3' UTR", "3' UTR",
"3' UTR", "3' UTR", "3' UTR", "3' UTR", "3' UTR", "3' UTR", "3' UTR"
), percentGC = c(0.676646706586826, 0.702594810379242, 0.63872255489022,
0.658682634730539, 0.728542914171657, 0.6187624750499, 0.578842315369261,
0.604790419161677, 0.63872255489022, 0.439121756487026), percentAT = c(0.323353293413174,
0.297405189620758, 0.36127744510978, 0.341317365269461, 0.271457085828343,
0.3812375249501, 0.421157684630739, 0.395209580838323, 0.36127744510978,
0.560878243512974)), spec = structure(list(cols = list(seqnames = structure(list(), class = c("collector_character",
"collector")), start = structure(list(), class = c("collector_double",
"collector")), end = structure(list(), class = c("collector_double",
"collector")), name = structure(list(), class = c("collector_character",
"collector")), score = structure(list(), class = c("collector_double",
"collector")), annotation = structure(list(), class = c("collector_character",
"collector")), percentGC = structure(list(), class = c("collector_double",
"collector")), percentAT = structure(list(), class = c("collector_double",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), skip = 1), class = "col_spec"), row.names = c(NA,
10L), class = c("spec_tbl_df", "tbl_df", "tbl", "data.frame"))
[Edit]:
> head (atac_esca)
seqnames start end name score annotation percentGC percentAT
1 chr1 1290095 1290596 ESCA_107 2.464378 3' UTR 0.6766467 0.3233533
2 chr1 1291115 1291616 ESCA_108 2.587929 3' UTR 0.7025948 0.2974052
3 chr1 1291753 1292254 ESCA_109 7.579962 3' UTR 0.6387226 0.3612774
4 chr1 1440824 1441325 ESCA_160 4.467274 3' UTR 0.6586826 0.3413174
5 chr1 1630188 1630689 ESCA_179 20.621324 3' UTR 0.7285429 0.2714571
6 chr1 2030218 2030719 ESCA_341 15.572581 3' UTR 0.6187625 0.3812375
> packageVersion("GenomicRanges")
[1] ‘1.38.0’
> class(atac_esca)
[1] "spec_tbl_df" "tbl_df" "tbl" "data.frame"
Can anyone tell me what I am doing wrong here?
[Using R Studio 1.2.5033 - R 3.6.3 - Windows 10]
Thanks in advance,
R.
[1]: https://rpubs.com/tiagochst/atac_seq_workshop
|
Output of `packageVersion("GenomicRanges")`, `head(atac_esca)` and `class(atac_esca)`? Never seen this error message and I use this function like every day. Could be Windows-related or your data frame is in fact not a df but a different class like any of these dplyr formats. I also suggest to never use T/F but always TRUE/FALSE to avoid misinterpretations. And yes, of course you have to load the package first before being able to call functions from it, `GenomicRanges` is not a base package so you will have to load it at every new session.
|
biostars
|
{"uid": 430279, "view_count": 1787, "vote_count": 1}
|
Hi Every one
I am a bit stuck at this error from Michigan Imputation Server, does any one know what this error means and any hint to fix?
> Error: More than 100 obvious strand flips have been detected. Please
> check strand. Imputation cannot be started!
Statistics:
Alternative allele frequency > 0.5 sites: 0
Reference Overlap: 99.80%
Match: 426,485
Allele switch: 66,772
Strand flip: 23,263
Strand flip and allele switch: 13,805
A/T, C/G genotypes: 642
Filtered sites:
Filter flag set: 0
Invalid alleles: 0
Duplicated sites: 286
NonSNP sites: 0
Monomorphic sites: 0
Allele mismatch: 465
SNPs call rate < 90%: 0
Thanks
|
beagle provided a java tool called `conform-gt` https://faculty.washington.edu/browning/conform-gt.html
a program for making alleles in a VCF file to be consistent with a reference VCF file, see an example:
```
java -jar conform-gt.24May16.cee.jar gt=input.vcf.gz chrom=$i ref=chr22.1kg.phase3.v5a.EUR.vcf.gz out=output.chr22.beagle.vcf.gz
```
|
biostars
|
{"uid": 350238, "view_count": 5935, "vote_count": 5}
|
I am attempting to re-create this figure from this link http://figshare.com/articles/_Enrichment_of_RNA_polII_on_the_exon_sides_of_exon_intron_and_intron_exon_junctions_/372514 (Figure A and B, the junction figures). I currently use a combination of ngsplot and deepTools for most of my metagene plots, but I have no idea how I would be able to plot something like this.
Any ideas?
|
I have not done something like that, but using deepTools this may work (assuming you have bigwigs for the sense and antisense):
1. get a a list of exon genomic positions, be sure that they contain the orientation.
2. For a figure similar to A, use computeMatrix reference-point, select as reference point the end of the region and 150 bp before and 150bp after the reference point.
3. For a figure similar to B do the same, except that you choose as reference point the start of the region.
|
biostars
|
{"uid": 167852, "view_count": 2077, "vote_count": 1}
|
We are in the process of developing analysis pipelines for WGS,RNA and Methyl-seq data. The first projects considers 100 patients with a common disease. All the analysis would be run on data from these patients. Our institute's computational center is offering us 5 nodes (24 CPU core, 2.6GHz clock speed, 128GB RAM memory each), I believe that necessary storage space would also be provided to us. Based on your experiences would you please tell me if having 5 nodes is going to be sufficient, I understand that there cannot be one single answer to this question but any help from you all is much appreciated.
|
Since you appreciate that there can't be one right answer here you are off to a good start.
Your requirements will/may change over time and you should build some flexibility into the allocation to access nodes with better specs (mainly RAM) in case you find that you are unable to complete some specific analysis. This recommendation assumes that no *de novo* assembly work would be involved since the specs (mainly memory) would be insufficient for that type of analysis.
|
biostars
|
{"uid": 197947, "view_count": 1436, "vote_count": 1}
|
Hello again Biostars community!
I am working on a project for my internship regarding the efficacy of different clustering techniques on RNA-seq data. I have used many different common clustering techniques in R and compared their results and the clusters they produce. Now, I have gotten to a point in the project where I want to analyze and explicitly show how my clustering is performing compared to "random" clustering. (Where I redistribute the "cluster" label across different groups of genes.)
To this point, I have identified k-means clustering as the most helpful for my dataset and identified some positive control groups that I know are biologically meaningful and should cluster together. For these positive controls, I have calculated a p-value and this is where my "random" groups come in!
For each of my clusters, I want to redistribute my genes as randomly as possible (within the limits of reproducibility) and examine how my p-values change for the positive control groups. Ideally I would like to see the p-values for my clusters showing much higher significance than the random clusters, but who knows? (I mean... I'm pretty sure I know, but that's why I'm doing this!)
I would like each new random cluster to contain the same number of genes as the clusters that I have already generated. (e.g. Cluster_1 had 60 genes, so Random_Cluster_1 should also have 60 genes etc.). Of course, I also need to make sure any one gene is only assigned to a single cluster.
Would anyone be able to recommend a robust method of "randomly" reassigning my genes to new clusters so that I can check my clustering performance?
Any feedback would be appreciated as I don't have much experience in this area (pretty new to bioinformatics!)
Thank you!
|
So you need to divide the genes (N=20000) into x clusters of different sizes. Each gene needs to be in one cluster.
Here some R solution (though not very optimal I guess - maybe there is already a function implemented in package that does that)
Example with N=20 genes and 4 clusters of size 2, 3, 5 and 10 genes.
assign_genes_randomly <- function(genes,cluster_sizes){
random_assignment <- sample(unlist(sapply(cluster_sizes,function(x){rep(x,x)})))
random_clusters <- sapply(cluster_sizes,function(x){genes[random_assignment==x]})
return(random_clusters)
}
genes <- 1:20
cluster_sizes <- c(2,3,5,10)
set.seed(123)
random_clusters <- assign_genes_randomly(genes,cluster_sizes)
Results :
random_clusters
[[1]]
[1] 6 20
[[2]]
[1] 12 18 19
[[3]]
[1] 1 3 9 11 14
[[4]]
[1] 2 4 5 7 8 10 13 15 16 17
|
biostars
|
{"uid": 339305, "view_count": 1950, "vote_count": 1}
|
Hi,
I have a table like this;
6 6:29002062:rs7755402 0 29002062 G A
6 6:29004091:rs9468471 0 29004091 A G
6 6:29006250:rs9468473 0 29006250 A G
6 6:29006493:rs9461499 0 29006493 C A
6 6:29006844:rs7743837 0 29006844 G A
I want to remove everything before "rs" in the second column. I know I can use egrep,
egrep -o "(rs\S+)" file | cut -d " " -f 2 > newfile
However, then I`m left with only the rs string;
rs7755402
rs9468471
rs9468473
rs9461499
rs7743837
rs6919044
rs41424052
rs6924824
rs6456886
rs6456887
But I actually want the other columns too.
Any help is greatly appreciated!
|
Shell is great, but you will like [csvtk](https://github.com/shenwei356/csvtk), a cross-platform, efficient, practical and pretty CSV/TSV toolkit.
Using `csvtk replace` to **edit specific column(s)**, [download](http://bioinf.shenwei.me/csvtk/download/), [usage](http://bioinf.shenwei.me/csvtk/usage/#replace).
$ csvtk replace -H -t -f 2 -p '.+:' -r '' file
6 rs7755402 0 29002062 G A
6 rs9468471 0 29004091 A G
6 rs9468473 0 29006250 A G
6 rs9461499 0 29006493 C A
6 rs7743837 0 29006844 G A
long-option version:
$ csvtk replace --no-header-row --tabs --fields 2 --pattern '.+:' --replacement '' file
|
biostars
|
{"uid": 244515, "view_count": 2479, "vote_count": 1}
|
## Use a real coding sequence:
rcds <- read.fasta("virus.fasta")
uco( rcds, index = "freq")
uco( rcds, index = "eff")
uco( rcds, index = "rscu")
uco( rcds, as.data.frame = TRUE)
Guys, anyone to help me. I used those functions as directed in uco(seqinr) package for relative synonymous codon usage (rscu) computaion the results were as shown below. The fasta file has multiple fasta sequences. What is wrong?
aaa aac aag aat aca acc acg act aga agc agg agt
0 0 0 0 0 0 0 0 0 0 0 0
ata atc atg att caa cac cag cat cca ccc ccg cct
0 0 0 0 0 0 0 0 0 0 0 0
cga cgc cgg cgt cta ctc ctg ctt gaa gac gag gat
0 0 0 0 0 0 0 0 0 0 0 0
gca gcc gcg gct gga ggc ggg ggt gta gtc gtg gtt
0 0 0 0 0 0 0 0 0 0 0 0
taa tac tag tat tca tcc tcg tct tga tgc tgg tgt
0 0 0 0 0 0 0 0 0 0 0 0
tta ttc ttg ttt
0 0 0 0
> uco( rcds, index = "eff")
aaa aac aag aat aca acc acg act aga agc agg agt
0 0 0 0 0 0 0 0 0 0 0 0
ata atc atg att caa cac cag cat cca ccc ccg cct
0 0 0 0 0 0 0 0 0 0 0 0
cga cgc cgg cgt cta ctc ctg ctt gaa gac gag gat
0 0 0 0 0 0 0 0 0 0 0 0
gca gcc gcg gct gga ggc ggg ggt gta gtc gtg gtt
0 0 0 0 0 0 0 0 0 0 0 0
taa tac tag tat tca tcc tcg tct tga tgc tgg tgt
0 0 0 0 0 0 0 0 0 0 0 0
tta ttc ttg ttt
0 0 0 0
> uco( rcds, index = "rscu")
aaa aac aag aat aca acc acg act aga agc agg agt
NA NA NA NA NA NA NA NA NA NA NA NA
ata atc atg att caa cac cag cat cca ccc ccg cct
NA NA NA NA NA NA NA NA NA NA NA NA
cga cgc cgg cgt cta ctc ctg ctt gaa gac gag gat
NA NA NA NA NA NA NA NA NA NA NA NA
gca gcc gcg gct gga ggc ggg ggt gta gtc gtg gtt
NA NA NA NA NA NA NA NA NA NA NA NA
taa tac tag tat tca tcc tcg tct tga tgc tgg tgt
NA NA NA NA NA NA NA NA NA NA NA NA
tta ttc ttg ttt
NA NA NA NA
> uco( rcds, as.data.frame = TRUE)
AA codon eff freq RSCU
aaa Lys aaa 0 0 NA
aac Asn aac 0 0 NA
aag Lys aag 0 0 NA
aat Asn aat 0 0 NA
aca Thr aca 0 0 NA
acc Thr acc 0 0 NA
acg Thr acg 0 0 NA
act Thr act 0 0 NA
aga Arg aga 0 0 NA
agc Ser agc 0 0 NA
agg Arg agg 0 0 NA
agt Ser agt 0 0 NA
ata Ile ata 0 0 NA
atc Ile atc 0 0 NA
atg Met atg 0 0 NA
att Ile att 0 0 NA
caa Gln caa 0 0 NA
cac His cac 0 0 NA
cag Gln cag 0 0 NA
cat His cat 0 0 NA
cca Pro cca 0 0 NA
ccc Pro ccc 0 0 NA
ccg Pro ccg 0 0 NA
cct Pro cct 0 0 NA
cga Arg cga 0 0 NA
cgc Arg cgc 0 0 NA
cgg Arg cgg 0 0 NA
cgt Arg cgt 0 0 NA
cta Leu cta 0 0 NA
ctc Leu ctc 0 0 NA
ctg Leu ctg 0 0 NA
ctt Leu ctt 0 0 NA
gaa Glu gaa 0 0 NA
gac Asp gac 0 0 NA
gag Glu gag 0 0 NA
gat Asp gat 0 0 NA
gca Ala gca 0 0 NA
gcc Ala gcc 0 0 NA
gcg Ala gcg 0 0 NA
gct Ala gct 0 0 NA
gga Gly gga 0 0 NA
ggc Gly ggc 0 0 NA
ggg Gly ggg 0 0 NA
ggt Gly ggt 0 0 NA
gta Val gta 0 0 NA
gtc Val gtc 0 0 NA
gtg Val gtg 0 0 NA
gtt Val gtt 0 0 NA
taa Stp taa 0 0 NA
tac Tyr tac 0 0 NA
tag Stp tag 0 0 NA
tat Tyr tat 0 0 NA
tca Ser tca 0 0 NA
tcc Ser tcc 0 0 NA
tcg Ser tcg 0 0 NA
tct Ser tct 0 0 NA
tga Stp tga 0 0 NA
tgc Cys tgc 0 0 NA
tgg Trp tgg 0 0 NA
tgt Cys tgt 0 0 NA
tta Leu tta 0 0 NA
ttc Phe ttc 0 0 NA
ttg Leu ttg 0 0 NA
ttt Phe ttt 0 0 NA
>
|
## Finally have resolved that problem using arrangement of the following functions:
## Use a real coding sequence:
rcds <- read.fasta("virus.fasta")[[1]]
uco( rcds, index = "freq")
uco( rcds, index = "eff")
uco( rcds, index = "rscu")
uco( rcds, as.data.frame = TRUE, NA.rscu = NA)
##The output dataframe is as indicated below:
> uco( rcds, as.data.frame = TRUE, NA.rscu = NA)
AA codon eff freq RSCU
aaa Lys aaa 16 0.068669528 1.8823529
aac Asn aac 6 0.025751073 0.9230769
aag Lys aag 1 0.004291845 0.1176471
aat Asn aat 7 0.030042918 1.0769231
aca Thr aca 7 0.030042918 1.8666667
acc Thr acc 3 0.012875536 0.8000000
acg Thr acg 2 0.008583691 0.5333333
act Thr act 3 0.012875536 0.8000000
aga Arg aga 8 0.034334764 3.6923077
agc Ser agc 0 0.000000000 0.0000000
agg Arg agg 2 0.008583691 0.9230769
agt Ser agt 6 0.025751073 2.5714286
ata Ile ata 6 0.025751073 1.0588235
atc Ile atc 3 0.012875536 0.5294118
atg Met atg 4 0.017167382 1.0000000
att Ile att 8 0.034334764 1.4117647
caa Gln caa 4 0.017167382 1.3333333
cac His cac 2 0.008583691 1.3333333
cag Gln cag 2 0.008583691 0.6666667
cat His cat 1 0.004291845 0.6666667
cca Pro cca 4 0.017167382 2.0000000
ccc Pro ccc 1 0.004291845 0.5000000
ccg Pro ccg 1 0.004291845 0.5000000
cct Pro cct 2 0.008583691 1.0000000
cga Arg cga 2 0.008583691 0.9230769
cgc Arg cgc 0 0.000000000 0.0000000
cgg Arg cgg 0 0.000000000 0.0000000
cgt Arg cgt 1 0.004291845 0.4615385
cta Leu cta 1 0.004291845 0.2857143
ctc Leu ctc 3 0.012875536 0.8571429
ctg Leu ctg 3 0.012875536 0.8571429
ctt Leu ctt 2 0.008583691 0.5714286
gaa Glu gaa 2 0.008583691 0.5714286
gac Asp gac 1 0.004291845 0.5000000
gag Glu gag 5 0.021459227 1.4285714
gat Asp gat 3 0.012875536 1.5000000
gca Ala gca 5 0.021459227 2.5000000
gcc Ala gcc 1 0.004291845 0.5000000
gcg Ala gcg 0 0.000000000 0.0000000
gct Ala gct 2 0.008583691 1.0000000
gga Gly gga 4 0.017167382 2.0000000
ggc Gly ggc 0 0.000000000 0.0000000
ggg Gly ggg 1 0.004291845 0.5000000
ggt Gly ggt 3 0.012875536 1.5000000
gta Val gta 2 0.008583691 1.1428571
gtc Val gtc 0 0.000000000 0.0000000
gtg Val gtg 2 0.008583691 1.1428571
gtt Val gtt 3 0.012875536 1.7142857
taa Stp taa 11 0.047210300 1.2222222
tac Tyr tac 4 0.017167382 0.5333333
tag Stp tag 8 0.034334764 0.8888889
tat Tyr tat 11 0.047210300 1.4666667
tca Ser tca 2 0.008583691 0.8571429
tcc Ser tcc 4 0.017167382 1.7142857
tcg Ser tcg 1 0.004291845 0.4285714
tct Ser tct 1 0.004291845 0.4285714
tga Stp tga 8 0.034334764 0.8888889
tgc Cys tgc 4 0.017167382 1.1428571
tgg Trp tgg 6 0.025751073 1.0000000
tgt Cys tgt 3 0.012875536 0.8571429
tta Leu tta 4 0.017167382 1.1428571
ttc Phe ttc 4 0.017167382 0.6153846
ttg Leu ttg 8 0.034334764 2.2857143
ttt Phe ttt 9 0.038626609 1.3846154
>
Thank you again in advance!
|
biostars
|
{"uid": 9518264, "view_count": 531, "vote_count": 1}
|
Hi,
Is anyone aware of pubilcly available T Cell Receptor repertoire data sets from immuno-sequencing, particularly from tumor or PBMC in cancer patients or mouse. I am looking for a summarized form repertoire profile dataset that includes clonotype (AA and NT), number and frequency of clones, and V, D, J gene name for each clonotype.
Thank you,
- Pankaj
|
This [paper][1] may help.
[1]: http://www.ncbi.nlm.nih.gov/pubmed/26017500
|
biostars
|
{"uid": 192991, "view_count": 2567, "vote_count": 2}
|
I have tried to break a problem down to two files. I want to take the most common 2nd column value for each sequence (1st column) then have the range of column 3 for those values. Also count the number of markers so the number of Fc06 for seq000001. Any idea how to do this? I was hoping for something easy on linux command line using awk but I just can't see it. The data is cM and chromosome file which I which to summarise.
file1
seq000001
seq000002
file2
seq000001 Fc06 35.948
seq000001 Fc06 36.793
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc06 37.009
seq000001 Fc08 37.009
seq000001 Fc06 37.368
seq000001 Fc06 37.368
seq000001 Fc06 37.368
seq000001 Fc06 37.368
seq000001 Fc06 37.368
seq000001 Fc06 37.58
seq000001 Fc06 37.916
seq000001 Fc06 37.916
seq000001 Fc06 37.916
seq000001 Fc06 37.916
seq000001 Fc06 37.916
seq000001 Fc08 37.916
seq000001 Fc06 37.916
seq000001 Fc06 37.916
seq000001 Fc06 37.916
seq000001 Fc06 37.916
seq000001 Fc06 37.916
seq000001 Fc06 38.1
seq000001 Fc06 38.664
seq000001 Fc06 38.923
seq000001 Fc06 38.978
seq000001 Fc06 39.324
seq000001 Fc06 40.341
seq000001 Fc06 40.341
seq000001 Fc06 40.341
seq000001 Fc06 40.543
seq000001 Fc06 40.543
seq000001 Fc06 40.543
seq000001 Fc06 40.992
seq000001 Fc06 41.189
seq000001 Fc06 41.189
seq000001 Fc06 41.347
seq000001 Fc06 41.39
seq000001 Fc06 41.39
seq000001 Fc06 41.39
seq000001 Fc06 41.399
seq000001 Fc06 41.399
seq000001 Fc06 41.399
seq000001 Fc06 41.657
seq000001 Fc06 41.71
seq000001 Fc06 41.785
seq000001 Fc06 41.923
seq000001 Fc06 42.237
seq000001 Fc06 42.634
seq000001 Fc06 42.963
seq000001 Fc06 43.285
seq000001 Fc06 43.478
seq000001 Fc06 43.478
seq000001 Fc06 43.478
seq000001 Fc06 43.478
seq000001 Fc06 43.744
seq000001 Fc06 43.744
seq000001 Fc06 45.234
seq000001 Fc06 45.234
seq000001 Fc06 46.272
seq000001 Fc06 46.272
seq000001 Fc06 46.272
seq000001 Fc06 46.272
seq000001 Fc06 46.272
seq000001 Fc06 51.086
seq000002 Fc06 63.754
seq000002 Fc06 63.754
seq000002 Fc09 13.078
seq000002 Fc09 13.078
seq000002 Fc09 13.078
seq000002 Fc09 16.342
seq000002 Fc09 16.342
seq000002 Fc09 16.342
seq000002 Fc09 16.342
seq000002 Fc09 17.004
seq000002 Fc09 17.004
seq000002 Fc09 17.004
seq000002 Fc09 17.004
seq000002 Fc09 17.004
seq000002 Fc09 17.004
seq000002 Fc09 17.004
seq000002 Fc09 17.004
seq000002 Fc09 17.004
seq000002 Fc09 17.004
seq000002 Fc09 17.806
seq000002 Fc09 18.544
seq000002 Fc09 19.59
seq000002 Fc09 19.59
seq000002 Fc09 19.59
seq000002 Fc09 19.59
seq000002 Fc09 19.59
seq000002 Fc09 19.59
seq000002 Fc09 19.59
seq000002 Fc09 19.59
seq000002 Fc09 19.59
seq000002 Fc09 19.59
seq000002 Fc11 19.59
seq000002 Fc09 19.59
seq000002 Fc09 39.857
seq000002 Fc09 20.558
seq000002 Fc09 20.892
seq000002 Fc09 21.323
Output
seq000001 Fc06 35.948-63.754 72
seq000002 Fc09 13.078-39.857 34
|
$ datamash -s -g 1,2 min 3 max 3 <test.txt | awk -v OFS="\t" '{print $1,$2,$3"-"$4}'
seq000001 Fc06 35.948-51.086
seq000001 Fc08 37.009-37.916
seq000002 Fc06 63.754-63.754
seq000002 Fc09 13.078-39.857
seq000002 Fc11 19.59-19.59
`sudo apt install datamash` if you are on ubuntu. Brew, conda has datamash is repos.
|
biostars
|
{"uid": 319990, "view_count": 1481, "vote_count": 1}
|
I'm trying to align FASTA files with a custom genome reference (GTF file), which contains a few sequences for genes that were inserted. So far I've just run cellranger count on these files and everything exited without errors. However, in the downstream analysis the result is not as expected, and I am wondering whether this could have to do with the alignment.
Basically, I am detecting the inserted sequences in many cells that should not contain it. One possibility is of course experimental error or contamination, but I was thinking it could also have to do with the alignment misaligning reads for those inserted sequences and detecting counts where there should not be counts.
Hence I was wondering **if there are parameters to tune the "sensitivity" of the genome alignment** in cellranger. Basically, I would want to be strict and discard reads which have even a small number of mismatches. Or if you have other suggestions to filter out potential misaligned reads, I'd be happy to know as well.
Cellranger count itself does not seem to have any relevant options, but it seems that on the background it runs STAR. Hence if it is possible to pass STAR arguments to cellranger, that could also be a possible solution (although I haven't found the relevant STAR parameters yet). Or maybe I'm just misunderstanding genome alignment altogether and there is not much to tune with the current algorithms?
|
There is no way to do this via cellranger without [altering the source code](https://kb.10xgenomics.com/hc/en-us/articles/360003877352-How-can-I-modify-the-STAR-alignment-parameters-in-Cell-Ranger-). You could always trying other gene quantification/alignment options though, like [alevin](https://salmon.readthedocs.io/en/latest/alevin.html) or [STARsolo](https://github.com/alexdobin/STAR/blob/master/docs/STARsolo.md) which would allow you full control over the parameters used. STARsolo even has directions for how to largely replicate cellranger results, so you could do that and tweak only your parameters of interest.
|
biostars
|
{"uid": 9472009, "view_count": 764, "vote_count": 1}
|
I have a question about how to change order of clusters on heatmap.
I tried to make heatmap using Complex Heatmap package and I made K-mean clusters. my code is below:
HM <- Heatmap(matrix2, km = 4, show_row_names = FALSE, show_column_names = F, top_annotation = ha_column, cluster_columns = FALSE, show_heatmap_legend = T)
draw(HM, heatmap_legend_side = "right", show_annotation_legend = F)
I got this heatmap as below.
https://ibb.co/jqGb77
<a href="https://ibb.co/jqGb77"><img src="https://preview.ibb.co/dRB9S7/Heat_map.png" alt="Heat map" border="0" /></a>
In this example, I want to move cluster 2 to top, cluster 1 in 2nd top, cluster 3 on 3rd and cluster 4 on the bottom. How can I re-order the position of clusters ?
|
I'm a big fan of *ComplexHeatmap* and again kudos to the developer for making it such a flexible package. However, I'm not immediately aware of a function that does (directly) what you want.
I would prefer to perform the k-means outside of the *ComplexHeatmap* package by just using `kmeans()`, and then manipulating the gene-to-cluster assignment vector in order to dictate the order of the clusters.
Create some random data (20 genes x 20 samples):
test <- matrix(rexp(400, rate=.3), ncol=20)
rownames(test) <- paste(rep("Gene", nrow(test)), 1:nrow(test), sep="")
colnames(test) <- paste(rep("Sample", ncol(test)), 1:ncol(test), sep="")
We then perform k-means with 4 centers and take a look at the gene-to-cluster assignment:
kclus <- kmeans(test, 4)
kclus$cluster
Gene1 Gene2 Gene3 Gene4 Gene5 Gene6 Gene7 Gene8 Gene9 Gene10 Gene11
3 3 2 1 2 1 3 1 2 1 4
Gene12 Gene13 Gene14 Gene15 Gene16 Gene17 Gene18 Gene19 Gene20
4 4 1 2 4 2 2 4 2
We then use the *split* parameter of `Heatmap()` in order to split the heatmap based on the k-means result:
split <- paste0("Cluster\n", kclus$cluster)
default.hmap <- Heatmap(test, split=split, cluster_row_slices = FALSE)
As we want to fix the order of the clusters, we have to re-order the gene-to-cluster assignment as a factor:
split <- factor(paste0("Cluster\n", kclus$cluster), levels=c("Cluster\n2","Cluster\n1","Cluster\n3","Cluster\n4"))
reorder.hmap <- Heatmap(test, split=split, cluster_row_slices = FALSE)
Then draw both the default-ordered and then re-ordered:
pushViewport(viewport(layout=grid.layout(nr=1, nc=2)))
pushViewport(viewport(layout.pos.row=1, layout.pos.col=1))
draw(default.hmap, newpage=FALSE)
upViewport()
pushViewport(viewport(layout.pos.row=1, layout.pos.col=2))
draw(reorder.hmap, newpage=FALSE)
upViewport()
upViewport()
<a href="https://ibb.co/b9vRqS"><img src="https://preview.ibb.co/guQ4c7/ghghg.png" alt="ghghg" border="0"></a>
|
biostars
|
{"uid": 306473, "view_count": 18750, "vote_count": 11}
|
Hello,
I am trying to extract reads at 1 base pair from many bam files. Each bam file has a bai file with the same name+.bai in the same folder.
When I run
samtools view myfile.bam
I get the output, but when I add coordinates such as
samtools view myfile.bam "chr1:1-100000"
I get the following error:
[bam_index_load] fail to load BAM index.
[main_samview] random alignment retrieval only works for indexed BAM files.
My understanding is that the bai file is the index it needs. Am I missing something?
Thanks in advance.
|
Some things to consider:
1. Your index may old or generated with a program other than samtools. You might want to regenerate it.
2. Make sure the BAM itself is sorted by coordinate. Also make sure that the names are correct between the two files, i.e., you didn't change the name of the BAM after indexing or something.
3. The index itself also needs to be accessible and readable by samtools.
|
biostars
|
{"uid": 215027, "view_count": 2605, "vote_count": 2}
|
I am conducting differential expression analysis in limma for a time course microarray experiment. I have 3 time points (1,2,3) and two conditions (control,disease). My contrast is formulated as:
```
pheno<-factor(c("disease.1","disease.1","disease.2","disease.2","disease.3","disease.3","control.1","control.1","control.2","control.2","control.3","control.3")
model<-model.matrix(~0+pheno)
```
```
contrast<-makeContrasts(disease.1-control.1, disease.2-control.2, disease.3-control.3,levels=model)
fit<-lmFit(expression,model)
fit2<-contrasts.fit(fit,contrast)
fit2<-eBayes(fit2)
topTableF(fit2)
```
How can I apply SVA with this experimental setup? Or is there an alternative? The challenge I am facing is SVA seems designed for two class experiments, because the null model requires leaving out the variable of interest, however in this case there isn't one variable but many.
Thanks!
|
You apply the sva function to a normalised matrix of expression values. I'm assuming that you're just looking for potential surrogate variables and not trying to correct for a known batch effect?
Edit: Also, I'd recommend you check out the time course section of [the limma user guide][1]
[1]: http://www.bioconductor.org/packages/release/bioc/vignettes/limma/inst/doc/usersguide.pdf
|
biostars
|
{"uid": 131137, "view_count": 3166, "vote_count": 1}
|
Hello,
I have written here about finding overlaps and I came a point where I got very confused. I have tried several methods for for finding overlaps but none of them seem to me logical. I have tried bedtools multi inter, bedops and bedmap. Though please help me a way to find these overlaps.
My data is consisted of 20 files (13 tumour, 7 normal). All of them are bed files. What I wanna know;
1. Overlapping peaks of both datasets.
2. Overlaps of from unique ( n=1) to n= 13 for tumour or 7 for normal overlaps.
3. Bedtools multi inter does this pretty good. However, I realised that it creates false negative overlaps. (2bp region of overlap which makes no sense).
4. With bedtools intersectbed; I have to make combinations of all of the samples which makes enormous amount combination that confuses me a lot.
Can somebody help me out who has done it before? It should not be that hard?
Thank you very much
Tunc
|
1. *Overlapping peaks of both datasets*.
First, if not sorted, make sure that your peak, tumour and normal BED files are sorted, e.g.:
```
$ sort-bed tumour01.unknown_sort_state.bed > tumour01.bed
```
Repeat sorting for the remaining peak, tumour and normal BED files, as needed. You only have to sort once, at the beginning.
Take the multiset union of your tumour BED files with *bedops*, and pipe that unioned set to a second *bedops* command, to find peaks that overlap all tumour elements:</p>
```
$ bedops --everything tumour01.bed tumour02.bed ... tumour13.bed | bedops --element-of 1 peaks.bed - > peaks_overlapping_tumour_sets.bed
```
Or all normal elements:
```
$ bedops --everything normal01.bed normal02.bed ... normal07.bed | bedops --element-of 1 peaks.bed - > peaks_overlapping_normal_sets.bed
```
Or elements from both categories:
```
$ bedops --everything tumour01.bed tumour02.bed ... tumour13.bed normal01.bed normal02.bed ... normal07.bed | bedops --element-of 1 peaks.bed - > peaks_overlapping_tumour_and_normal_sets.bed
```
If you're trying to do something else, please clarify the kind of set operation or association that you want to do.
For example, do you need to know which tumour or normal element's subset overlaps with a particular peak? The *bedmap* tool can help you here, but you need to preprocess your tumor and normal element subsets, first. Feel free to follow up.
2. *Overlaps of from unique ( n=1) to n= 13 for tumour or 7 for normal overlaps*.
You can use a generalization of this approach for finding elements common to all N subsets. For example, for N=13, where `A.bed` through `N.bed` are your 13 tumour element sets:
```
$ N=13
$ bedops --everything A.bed B.bed C.bed ... N.bed \
| bedmap --count --echo --delim '\t' - \
| uniq \
| awk -vN=${N} '$1==N' \
| cut -f2- \
> common_to_all_N_tumour_subsets.bed
```
You can modify this approach for N-1 (12) subsets, N-2 (11) subsets, and so on, by modifying the *awk* test:
```
$ N=13
$ bedops --everything A.bed B.bed C.bed ... N.bed \
| bedmap --count --echo --delim '\t' - \
| uniq \
| awk -vN=${N} '$1==(N-1)' \
| cut -f2- \
> common_to_N_minus_1_tumour_subsets.bed
```
You would repeat this for N=7 for your seven normal set files.
Once you have files `common_to_*.bed` that you need, you can use *bedops* or *bedmap* with each of them to do overlap or association tests with peaks, *e.g.*:
```
$ bedmap --echo --echo-map peaks.bed common_to_all_N_tumour_subsets.bed > common_tumour_elements_that_overlap_each_peak.bed
```
|
biostars
|
{"uid": 167630, "view_count": 5280, "vote_count": 2}
|
<p>Hello friends, please help me</p>
<p>i entered these codes, but whenever i use the output as input to geworkbench, it says that" <strong>could not parse line #1, line should have 12 columns but has 13 columns, which need manually add a tab at the beggining of the header to make it a valid RMA format</strong>"</p>
<pre>
library(affy)
> data <- ReadAffy()
> exp <- rma(data)
Background correcting
Normalizing
Calculating Expression
> control <- grep("AFFX",rownames(exp))
> exp <- exp[-control,]
> e <- exprs(exp)
> e <- apply(e,1,function(x) x-median(x))
> e.scaled <- t(scale(t(e),center=FALSE))
> write.exprs(exp, file="output.txt", sep="\t")</pre>
<p><strong>where i did wrong please??</strong></p>
|
Change:
write.exprs(exp, file="output.txt", sep="\t")
to:
write.exprs(exp, file="output.txt", sep="\t", row.names=FALSE)
|
biostars
|
{"uid": 150455, "view_count": 1946, "vote_count": 1}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.