cannin/biostars_qa huggingface dataset:
Question: Dear all, I have easy script in bash using awk language. I filtrate bam file by GC content (see at code), but I need to get on output bam file too with header. Could you help me with this? thank you My code:

#!/bin/bash

for i in 54321*.bam
do
samtools view -h /home/filip/Desktop/Analyza\ NIFTY\ and\ CNVs/NIFTY\ pooling009/$i | awk '{ n=length($10); print gsub(/[GCCgcs]/,"",$10)/n,"\t",$0 }' | awk '($1 <= 0.6 && $1 >= 0.3){print $0}' | awk '!($1="")' | samtools -bS - > z$i;
done

Answer: you could use your code without including the header in a first samtools run (and you wouldn't have to check whether each line is a header or a read, you'll only be dealing with reads), and then embed the header from the original bam in a subsequent samtools run. something like this:

for bamfile in *bam; do
samtools view -H $bamfile > temp.sam
samtools view $bamfile | yourcode >> temp.sam
samtools view -bS temp.sam > mod_$bamfile
done
Question: hello all,

i am having a hard time in using bcftools set set some variants in my vcf to missing.

as i understand missing2ref is no longer used and replaced with setGT. having said that, it is not clear how to use it.

i need to set any variant with genotype quality (GQ) < 20 to missing. this will require that i use the plugin +fill-tags at the first stage, but then how do i use the setGT plugin? how is the filter command written?

i am so lost here. thanks in advance

Answer: Below is a Python API solution using the `pyvcf` [submodule](https://sbslee-fuc.readthedocs.io/en/latest/api.html?highlight=VcfFrame.from_dict#module-fuc.api.pyvcf) from the `fuc` [package](https://sbslee-fuc.readthedocs.io/en/latest/readme.html) I wrote.

Imagine you have the following data:
```
>>> from fuc import pyvcf
>>> data = {
... 'CHROM': ['chr1', 'chr1', 'chr1', 'chr1'],
... 'POS': [100, 101, 102, 103],
... 'ID': ['.', '.', '.', '.'],
... 'REF': ['G', 'T', 'A', 'A'],
... 'ALT': ['A', 'C', 'T', 'C'],
... 'QUAL': ['.', '.', '.', '.'],
... 'FILTER': ['.', '.', '.', '.'],
... 'INFO': ['.', '.', '.', '.'],
... 'FORMAT': ['GT:GQ:DP', 'GT:GQ:DP', 'GT:GQ:DP', 'GT'],
... 'A': ['0/0:48:3', '0/0:19:3', './.:.:.', '0/1'],
... 'B': ['0/1:3:5', '0/1:20:8', '0/0:29:12', '0/0'],
... 'C': ['0/0:16:3', '1/0:32:8', '0/1:25:9', '0/0'],
... }
>>> vf = pyvcf.VcfFrame.from_dict([], data)
>>> vf.df
CHROM POS ID REF ALT QUAL FILTER INFO FORMAT A B C
0 chr1 100 . G A . . . GT:GQ:DP 0/0:48:3 0/1:3:5 0/0:16:3
1 chr1 101 . T C . . . GT:GQ:DP 0/0:19:3 0/1:20:8 1/0:32:8
2 chr1 102 . A T . . . GT:GQ:DP ./.:.:. 0/0:29:12 0/1:25:9
3 chr1 103 . A C . . . GT 0/1 0/0 0/0
```

We can then define a custom method (`one_row`) to be applied to each row to convert genotypes calls with GQ < 20 to missing:

```
>>> def one_row(r):
... format_list = r.FORMAT.split(':')
... # This method automatically finds the appropriate missing value ('./.', '.', './.:.:.', etc.).
... missval = pyvcf.row_missval(r)
...
... if 'GQ' in format_list:
... i = format_list.index('GQ')
... else:
... # This row doesn't have GQ, return the entire row as is.
... return r
...
... def one_gt(g):
... gq = g.split(':')[i]
...
... if gq.isnumeric():
... gq = int(gq)
... else:
... # This genotype doesn't have a numeric GQ value (probably has missing value '.'), keep it as is.
... return g
...
... if gq >= 20:
... # This genotype has GQ >= 20, keep it as is.
... return g
... else:
... return missval
...
... r[9:] = r[9:].apply(one_gt)
...
... return r
...
```

We then apply the method:

```
>>> vf.df = vf.df.apply(one_row, axis=1)
>>> vf.df
CHROM POS ID REF ALT QUAL FILTER INFO FORMAT A B C
0 chr1 100 . G A . . . GT:GQ:DP 0/0:48:3 ./.:.:. ./.:.:.
1 chr1 101 . T C . . . GT:GQ:DP ./.:.:. 0/1:20:8 1/0:32:8
2 chr1 102 . A T . . . GT:GQ:DP ./.:.:. 0/0:29:12 0/1:25:9
3 chr1 103 . A C . . . GT 0/1 0/0 0/0
```

Note that you can easily read and write VCF files too:

```
vf = pyvcf.VcfFrame.from_file('in.vcf')
vf.to_file('out.vcf')
```

Let me know in the comment if you have any questions.
Question: Hello,
I've my BLAST alignment as below:

Query 1 AGTAAAGCCGACTCGGCTATCCATGGGTGAGAACCTAAAGCCGAGTCGGCTTTAAGTTCT 60
|||||||||||||||||| |||||||||| ||||||||||||||||||||||||||||||
Sbjct 2913022 AGTAAAGCCGACTCGGCTGTCCATGGGTGGGAACCTAAAGCCGAGTCGGCTTTAAGTTCT 2913081

Query 61 GGAAAGTCCCATTTGTCCAGCAGGAAAAGCCGACTCGGCTTTCCTGGTGTTGGGGCAAAA 120
||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||
Sbjct 2913082 AGAAAGTCCCATTTGTCCAGCAGGAAAAGCCGACTCCGCTTTCCTGGTGTTGGGGCAAAA 2913141

Query 121 GCCGACTCGGCTTTTTCCTCTGTTATGAGC**R**TTGGtttttttCCCGTTTTCTTTGAGTAA 180
||||||||||| |||||||||||||||||| ||||| ||||| |||||||||||||||||
Sbjct 2913142 GCCGACTCGGCCTTTTCCTCTGTTATGAGC**G**TTGGTCTTTTTTCCGTTTTCTTTGAGTAA 2913201

Query 181 TTGCTTTGGATTCTTTCACTTACGGTTCTTGATTTGTAGAGTTATAAGGGAGTATTAAGG 240
|||||||||||||||||||||| || ||||||||||| ||||||||||||||||||||||
Sbjct 2913202 TTGCTTTGGATTCTTTCACTTATGGCTCTTGATTTGTGGAGTTATAAGGGAGTATTAAGG 2913261

Query 241 AGAATAATACTCATGAATGGCGTTGAATTGGATGATCATCAATATGATCATTAAGAGTGA 300
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sbjct 2913262 AGAATAATACTCATGAATGGCGTTGAATTGGATGATCATCAATATGATCATTAAGAGTGA 2913321

Query 301 T 301
|
Sbjct 2913322 T 2913322

I want the nucleotide thats exactly aligning with the letter R in the query sequence. As you can see the R aligns with a G in the database.

Is there a tool in Biopython or R that can help me code and get me the output?

I've 26101 such sequences where I need the nucleotide that matches with the letters W,R,K,Y,M,N,S in the query sequence. Manually browsing through the alignment and deciding the nucleotide thats matching with it will not cut it as you can see.
Any help would be appreciated. Thanks!

Answer: Not the most beautiful solution..

awk '{if(/^Q/ || /^S/){print $3}}' input.file \
| paste - - \
| awk 'BEGIN{OFS=FS="\t"}{for(i=1;i
Question: Hello,

I am developing customized pipelines for ChIP-seq analysis using Snakemake. I want share it, so I created model workflows that people can execute immediatly after downloading the code. It handles file conversion, mapping, peak-calling... And uses public data from GEO database. However it requires people to download these data themselves. I would like to include an automatic download of the data (sra or fastq files), ideally by using GSM/GSE or SRR identifiers.

So far I've found several ways:

* SRA toolkit's fastq-dump function.

fastq-dump --outdir <outdir> <srr_ids>

However this way is insanely slow (as stated here).

* SRAdb R package

getSRAfile( in_acc = "<srr_ids>", sra_con = sra_con, destDir = <dir>, fileType = 'sra' )

This requires using this command first:

geometadbfile <- getSRAdbFile(destdir = <dir>, destfile = "SRAmetadb.sqlite.gz")

which downloads locally an sqlite file of 16Go. Could be fine if I were to use it locally, but I don't want users of my pipeline to be forced to do so...

* Biopython's Bio.Geo module

Not sure how this one works... http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc123

The object Entrez.esearch doesn't help me finding out the ftp URL or so.

I think there should be a way to download data in a more simple way?

Any idea will be greatly appreciated!

Answer: I just found out here that I can download the sra files with SRA toolkit, using the prefetch command:

prefetch

It's quite fast, the only issue is that it seems there is no output directory option. It's worth mentioning that the data is automatically downloaded to `/home//ncbi/public/sra/.sra` (not mentioned in the doc!)

I can then run fastq-dump to get fastq files:

fastq-dump --outdir /home//ncbi/public/sra/.sra

Surprisingly, it looks a lot faster than doing these 2 steps at once with fast-dump...
Question: hello friends,

i have a list of GO terms, for example GO:0005975, how i can fine that which of these GO terms is related with cirus fruit senescence please???

Answer: Try [DAVID][1] for the start, than you should read the manuals of some Bioconductor packages.

- [topGO][2]
- [GOexpress][3]
- https://www.biostars.org/p/245/
- https://www.biostars.org/p/8190/
- https://www.biostars.org/p/85514/
- [GO Analysis][4]
- [GO analysis with R code][5]

Read properly and perform the commands for the dataset provided by the packages. Don't simply try to copy paste, to do analysis yourself. Understand the commands properly, what's going on and then try to implement the codes accordingly.

[1]: http://david.abcc.ncifcrf.gov/
[2]: http://www.bioconductor.org/packages/release/bioc/vignettes/topGO/inst/doc/topGO.pdf
[3]: http://www.bioconductor.org/packages/release/bioc/vignettes/GOexpress/inst/doc/GOexpress-UsersGuide.pdf
[4]: http://cals.arizona.edu/~anling/MCB516/lecture22.pdf
[5]: http://davetang.org/muse/2010/11/10/gene-ontology-enrichment-analysis/
Question: Hello,
I'd like to filter for sites that have a DP>5 in my normal sample and DP>10 in the tumor. My vcf has two samples columns, TUMOR NORMAL. How do I do that with a bcftools expression? I see in the documentation how to apply the filter for one or all samples in a vcf row but I couldn't find a way to specify the sample name.
Thanks a lot.

Answer: Actually bcftools supports this also. This worked for me:

`bcftools filter -s MY_FILTER -m + -e "FMT/DP[0] <= 5 || FMT/DP[1] <= 10" my.vcf`

which appends MY_FILTER based on the exclusion criteria
Question: I've got a list of codding genes and I would like to get the cellular location of the expressed proteins, all at once. I already looked up on uniprot but wasn't able to solve it.

Answer: You could use data from the [human protein atlas][1] or [neXtProt][2] for this.

[1]: http://www.proteinatlas.org/humanproteome
[2]: http://www.nextprot.org/
Question: I am trying to test for over-representation of a set of overlapped chip-seq peaks between constitutive exons and alternatively spliced exons.

I have a bed file that contains my overlapped chip peaks, a bed file that contains constitutive exons and a bed file that contains alternatively spliced exons (generated using a custom script provided by some authors of a paper). I am interested in running a statistical test that tells me whether my overlapped peaks are over-represented / enriched in my constitutive exon file, or alternatively spliced exon file individually.

I thought about running a hypergeometric test using the phyper function in R. But I'm not quite sure what numbers I would use specifically.

I also attempted to use the bedtools fisher test by using my overlapped chip-seq peak file and testing that against my con exon file and then my alt exon file seperately. This returned a p-value of 0 for both which I guess doesn't make much sense (though I am not very math-oriented). I mostly work on wet-lab stuff as an assistant.

Any help is appreciated.

Answer: You can use the R/Bioconductor package [regioneR][1] for this. It implements a statistical test for the association of genomic regions (such as chip peaks and exons) based on random permutations.

In this case I think the best aproach would be to "flip" the question and ask whether alternatively spliced (or constitutive) exons tend to be associated with the chip peaks and use the "resampling" randomization strategy.

For example (untested code!)

library(regioneR)

chip.peaks <- toGRanges("chip.peaks.bed")
alt.exons <- toGRanges("alt.exons.bed")
const.exons <- toGRanges("const.exons.bed")

all.exons <- c(alt.exons, const.exons)

pt <- permTest(A=alt.exons, B=chip.peaks, universe=all.exons,
randomize.function = resampleRegions, evaluate.function = numOverlaps,
ntimes = 1000)

pt
plot(pt)

This will create 1000 random sets of exons and test if the alt.exons are more associated with the peaks than one could expect by chance.

You can find more information about how to use regioneR and about permutation tests in the [package vignette][2].

[1]: https://bioconductor.org/packages/release/bioc/html/regioneR.html
[2]: https://bioconductor.org/packages/release/bioc/vignettes/regioneR/inst/doc/regioneR.pdf
Question: Dear all,

I have checked many post in biostar and other blogs to find orthologous and paralogous gene identification across/within the species. Most of them are suggesting for Best Reciprocal Blast Method(BBRM). But i have 2 leaf and 2 rhizome transcript samples. I have to find out orthologous and paralogous genes between these set. Shall i use BRBM method or are there any other better way to do it.

Please suggest any tools.

Thanks all

Answer: Thanks for the suggestion.

If i am not mistaken, you are suggesting BRBM (Best Reciprocal Blast method) to use. If so i will find orthologous genes between samples. Could you please suggest any way to find paralogous genes as well
Question: Hello,

I have a couple of bam files from **exome sequencing** and a list of regions that I want to perform variant calling and variant annotation on. My goal is to look for evidence of mutations in those regions that go beyond canonical LOF protein coding mutations.

I am thinking of extracting the regions of interest from a bam, converting to a vcf and then annotating it using snpEff or something like that. The following is my commandline:

# add read groups
picard AddOrReplaceReadGroups I=sample.bam O=sample.fixed.bam RGID=4 RGLB=lib1 RGPL=illumina RGPU=unit1 RGSM=20

# run gatk
java GenomeAnalysisTK.jar -T HaplotypeCaller -R human_g1k_v37.fasta
-I sample.fixed.bam --emitRefConfidence GVCF --variant_index_type LINEAR --variant_index_parameter 128000 --genotyping_mode DISCOVERY -stand_emit_conf 10 -stand_call_conf 30 -o sample.gvcf

# run snpeff
snpeff -c snpEff.GRCh37.config -ud 10 -classic GRCh37.75 sample.gvcf > sample.snpeff.gvcf

Q1. Is my approach correct? Is this approach applicable to WGS and RNASeq as well?

My vcf file generated in this manner has missing ALT info - it says . How can I fix this?

#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT 20
chr4 54243811 . C . . END=54243904 GT:DP:GQ:MIN_DP:PL 0/0:208:99:129:0,120,1800
chr4 54243905 . T C, 10162.77 . DP=280;MLEAC=2,0;MLEAF=1.00,0.00;MQ=59.94 GT:AD:DP:GQ:P
L:SB 1/1:0,268,0:268:99:10191,805,0,10191,805,10191:0,0,160,108
chr4 54243906 . C . . END=54244236 GT:DP:GQ:MIN_DP:PL 0/0:170:99:37:0,99,1485
chr4 54244237 . T . . END=54244238 GT:DP:GQ:MIN_DP:PL 0/0:36:90:35:0,90,1350
chr4 54244239 . C . . END=54244241 GT:DP:GQ:MIN_DP:PL 0/0:34:72:34:0,72,1080
chr4 54244242 . G . . END=54244244 GT:DP:GQ:MIN_DP:PL 0/0:33:63:33:0,63,945
chr4 54244245 . C . . END=54244247 GT:DP:GQ:MIN_DP:PL 0/0:41:78:39:0,78,1170

Q2. Also, can someone suggest a better approach for creating a vcf for just specific regions of bam file?

Answer: You can use the -L flag of HaplotypeCaller to limit the intervals in which variants are detected as specified by a bed file.

> --intervals / -L One or more genomic intervals over which to operate Use this option to perform the analysis over only part of the genome.
> This argument can be specified multiple times. You can use
> samtools-style intervals either explicitly on the command line (e.g.
> -L chr1 or -L chr1:100-200) or by loading in a file containing a list of intervals (e.g. -L myFile.intervals). Additionally, you can also
> specify a ROD file (such as a VCF file) in order to perform the
> analysis at specific positions based on the records present in the
> file (e.g. -L file.vcf). Finally, you can also use this to perform the
> analysis on the reads that are completely unmapped in the BAM file
> (i.e. those without a reference contig) by specifying -L unmapped.

from https://software.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_engine_CommandLineGATK.php
Question: I'm working with drugbank ids and I'd like to incorporate adverse effects from OFFSIDES database http://tatonettilab.org/offsides/. I'll appreciate help in mapping between the ids.

Answer: looks like NIH applies RxNorm ids to drugbank, maybe use their mapping?
https://www.nlm.nih.gov/research/umls/rxnorm/sourcereleasedocs/drugbank.html
Question: Hello All,

I am trying to reanalyze a WGS dataset that was generated a few years ago. I've access to the old BAM files and I was able to create paired fastq's for each sample. Since I'll be using picard for marking duplicates I would like to add the read group information at the time of aligning my fastq's with BWA mem. From the old bam file, I was able to get lines matching the '@RG' lines. But there seems to be multiple read group ID present in the bam file. From the BWA documentation, it seems that the correct way of adding the read group info is by **bwa mem -R '@RG\tID:foo\tSM:bar\tLB:library1'**. I believe here both foo and bar are unique for each sample. For my particular case, how should multiple read group info to BWA? Hope the question is clear. I've very limited experience with WGS. I appreciate all your help and comments.

samtools view -H sampleA.bam | grep '^@RG'
@RG ID:AVKMG.3 SM:sampleA LB:0993462810_Illumina PL:ILLUMINA PU:AVKMGDSXX191015.3.GTCCACAG-CGCGAATA CN:BI DT:2016-10-15T04:00:00+0000 DS:KS-9108

@RG ID:AJJMK.4 SM:sampleA LB:0993462810_Illumina PL:ILLUMINA PU:AJJMKDSXX191014.4.GTCCACAG-CGCGAATA CN:BI DT:2016-10-14T04:00:00+0000 DS:KS-9108

@RG ID:AKKMD.4 SM:sampleA LB:0993462810_Illumina PL:ILLUMINA PU:AKKMDDSXX191014.4.GTCCACAG-CGCGAATA CN:BI DT:2016-10-14T04:00:00+0000 DS:KS-9108

@RG ID:UGGMD.4 SM:sampleA LB:0993462810_Illumina PL:ILLUMINA PU:UGGMDDSXX191014.4.GTCCACAG-CGCGAATA CN:BI DT:2016-10-14T04:00:00+0000 DS:KS-9108

Answer: Most likely the alignments have been done separately and bam files merged afterwards.
Question: Hi,

I have PDX RNA-seq data.I want to separate the reads of mouse and human,before comparing with tumor RNA-seq data. Is there any tool to do that?

After removing the mouse reads I want to do differential expression between primary tumors and PDX tumors.

Thanks,
Ron

Answer: [BBSplit][1] will map the reads simultaneously to multiple references, and output in multiple files, one per reference. Since you're looking at RNA-seq of tumors, you would want to increase the sensitivity over the default, using settings like (if mapping to the genomes):

bbsplit.sh in=reads.fq ref=hg19.fa,mm10.fa minratio=0.5 maxindel=100000 minhits=1 basename=out_%.fq ambig2=all local

If mapping to transcriptomes, `maxindel=500` would probably be better than `100000`.

[1]: https://sourceforge.net/projects/bbmap/
Question: Hello. As I am trying to download genomes from NCBI using command [centrifuge-download], a warning keeps popping up: "line 24: dustmasker: command not found." The downloaded files end up with 0 Kb and all the subsequent steps are unperformable. The version is centrifuge-1.0.3-beta and the command is as follow:
centrifuge-download -o library -m -d "archaea,bacteria,viral" refseq > seqid2taxid.map
Anyone helps me and saves my life :(

Answer: Or download a dustmasker binary for your system [here][1] - it is part of the BLAST+ package

[1]: ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/
Question: Hi all,

Can you tell me what's the meaning of @RG / group in the SAM format. Can I consider it as the very same thing as 'Sample-name' ?

Is there a case where one could find more than one @RG tag in a BAM file ?

Can mpileup (or another software) use this @RG flag to put more than one sample column in a VCF file.

If yes, what does it mean for the QUAL column ?

If no, under which condition can we find more than one sample column in a VCF ?

Thanks,

Pierre

Answer: For Illumina reads, RG typically groups reads from a lane. GATK requires/assumes such a use in several components. At least one should not put reads from multiple libraries in the same RG.

When reading the input BAMs, samtools tries to group reads based on their @RG-SM tag. If there are no @RG lines, it implicitly inserts the following line into the header:

@RG ID:filename SM:filename

The VCF spec is very clear about the definition of QUAL: the probability of there being no SNPs in any samples.
Question: Hi,

Is any tool/method to convert article title to pubmed ID? Anyone know?

Thank you,

Answer: from lxml import etree
from requests import get
import sys
import os

url_for_get_id = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&field=title&term=\"{}\""
url_for_get_title = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id={}&retmode=XML"

def xml_id_or_title_extractor(page):

"""extract the ids from page and return that as string"""

content = etree.fromstring(page)
root = content.getroottree()
result = [item.text for item in root.xpath(xpath)]
if len(result)<1:
return "Not Found!!"
return ",".join(result)

def write_to_file(_list):

result = open("title_pubmedid_result.txt","a")

for title in _list:
try:
title = title.strip()
page = get(URL.format(title)).content
_id = xml_id_or_title_extractor(page)
result.write(_id + "\t" + title + "\n")
print (title,"===>","OK")
except:
print("An Exception occurred!! on \n <{}>".format(title))
result.write("ERROR" + "\t" + title + "\n")
result.close()

def run(title_list):

if len(sys.argv) > 2:
path = os.getcwd()
file_path = path+"/"+sys.argv[2]
try:
read_file = [item.strip() for item in open(file_path).readlines()]
write_to_file(read_file)
except FileNotFoundError:
print ("your file is not exsists or input file not in same directory")
except:
print ("there is a problem with your input file")
else:
write_to_file(title_list)

if __name__ == "__main__":

print ("the script is running\n")
print ("this is a script to convert article paper to pubmedid and vice versa")
print ("*"*20)

if len(sys.argv)<2:
print ("\nyour arguments are not enough !!\n \n Use this format : for example \n\n< python pubmedid_to_title.py -t2id your_file.txt> for reading from file\n\n\
or \n\n< python pubmedid_to_title.py -t2id> for reading from a list")
sys.exit()
elif sys.argv[1] == "-t2id":
URL = url_for_get_id
xpath = "//Id"
_id_or_title_list = ["Differentially Expressed miRNAs in Hepatocellular Carcinoma Target Genes in the Genetic Information Processing and Metabolism Pathways.",
"miR-429 inhibits migration and invasion of breast cancer cells in vitro."]

elif sys.argv[1] == "-id2t":
URL = url_for_get_title
xpath = "//ArticleTitle"
_id_or_title_list = ["18456660","19196975"]
else:
print ("use -id2t for convert id to title or -t2id for convert title to id as first argument!! ")
sys.exit()
# suppose you have a list of paper's title, for example two titles or two id ==> _id_or_title_list list
# you can edit it ...

# if you wnat to read from a file, your file name come after it, be careful the script and file directory must be in same directory
# also each line should be just one title
# for example type this:
# python title_to_pubmedid.py -t2id your_file.txt
# first argument must be -t2id for convert titles to ides and -id2t for reverse search
#SO YOU HAVE TWO CHICE: 1:READ FROM FILE 2:EDIT THE ABOVE LIST :D
run(_id_or_title_list)
Question: Can I download gene expression data from ICGC? If so, how? Do I need controlled access?

Answer: Gene expression data is open. Not sure if that's what you need but you can download it the following way:

On Cancer Projects page on the left panel check EXP-S (Sequencing-based Gene Expression) and/or EXP-A (Array-based Gene Expression) in "Available Data Type section". You'll see all projects for which specified data type(s) are available ([example][1])

Then you can download expression data for all donors of one project through data repository: for example current data release has .tsv exp_array.BRCA-US.tsv.gz and exp_seq.BRCA-US.tsv.gz for [BRCA-US project][2]

You can also download gene expression data for one donor: on Donors page apply the same filtering as previously metioned ([example][3]). When you click on donor ID you'll be taken to donors page where you can click "Download Donor Data" button and select the type(s) of data you want.

Hope this helps.

[1]: https://dcc.icgc.org/projects/details?filters=%7B%22project%22:%7B%22availableDataTypes%22:%7B%22is%22:[%22exp_seq%22,%22exp_array%22]%7D%7D%7D
[2]: https://dcc.icgc.org/releases/current/Projects/BRCA-US
[3]: https://dcc.icgc.org/search?filters=%7B%22donor%22:%7B%22availableDataTypes%22:%7B%22is%22:[%22exp_seq%22,%22exp_array%22]%7D%7D%7D