This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| import torch | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| from torch.nn.modules.utils import _pair, _quadruple | |
| class MedianPool2d(nn.Module): | |
| """ Median pool (usable as median filter when stride=1) module. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Bio import Entrez | |
| def fetch_gene_coordinates(search_term): | |
| handle = Entrez.esearch(db="gene", term=search_term) | |
| rec = Entrez.read(handle) | |
| gene_id = rec["IdList"][0] # assuming best match works | |
| handle = Entrez.efetch(db="gene", id=gene_id, retmode="xml") | |
| rec = Entrez.read(handle)[0] | |
| gene_locus = rec["Entrezgene_locus"][0] |