在利用python处理地理数据的时候,通常用到gdal,但自从arcpy问世后,其强大的数据处理功能也受到青睐,因此可能需要在一段代码中同时import gdal 和arcpy。 arcpy默认安装在arcgis安装目录下,但在python目录下arcgis10.x文件夹下建立了一个.pth文件,并在其中指定了arcpy的安装路径。gdal则安装在python目录下。为了同时导入gdal和arcpy,需要将.pth文件copy到C:\Python27\Lib目录下(以arcgis10.2为例,arcgis10.2支持的python版本是python 2.7.3) Python 2.7.3 (default, Apr 10 2012, 23:31:26) on win32 Type copyright, credits or license() for more information. import arcpy from osgeo import gdal
Part 1 : Genetic diversity and cluster analysis case analysis Related Software:Powermarker V3.25;Figtree Case used Data : 169clDiliPowerMarker Key steps: 1. 右击”dataset”后, 左击弹出的“import”,左击“Browse”选择数据文件所在文件夹。 2.Column Delimeters(列定义项)选项里选中“Space”,点击“next”。 3.Column列中line和group的类型改为“categorical”,操作方法为左击line后,左击Categorical, 左击group后,左击Categorical. 注意右侧Hierarchy框中,level-1下拉框选择“line”,level-2下拉框选择“group”,点击“next”及随后的“finish”至数据录入成功。 4. 点击窗口顶部“Analysis”,在phylogene后拉框中选择compute frequence,在弹出的对话框中点击数据文件名“169clDiliPowerMarker”后,注意选择右侧相应的计算水平level-1,点击submit. 5. 点击窗口顶部“Analysis”,在Phylogene后拉框中选择“Frequence Based Distance”,在弹出的对话框中点击数据文件名“169clDiliPowerMarker.frequency”后,注意选择右侧距离计算方法,最后点击submit。 6. 点击窗口顶部“Analysis”,在phylogene后拉框中选择“UPGMA/ NJ tree”,在弹出的对话框中点击数据文件名“169clDiliPowerMarker.frequency.share allele”后,注意选择右侧聚类模型,最后点击submit。 7. 点击窗口顶部“Data”,选择Batch export, 弹出的对话框中点击以NJ或upgma结尾的数据文件名,选择输出文件保存路径,再点击submit. 8.用Figtree软件打开输出树形图文件进行编辑。 Part2 : Association mapping Case Studies By using the data files in the tutorial dataset, we create following cases to illustrate the usage of association study performed by GLM and MLM. Case Data type 1 Phenotype + Candidate SNP markers (haploid) 2 Phenotype + Candidate SNP markers (haploid) + Q 3 Phenotype + Candidate SNP markers (haploid) + Q + K 4 Phenotype + SSR markers (haploid) 5 Phenotype + Candidate SNP markers (diploid) In practice, the association study may involve the combination of two or more cases listed above.. For example, diploid SSR markers is equivalent to Case 5 + 6. Case 1: Phenotype + Candidate SNP markers (haploid) This is the simplest association analyses with assumption with completely random mating population. Files used 1) d8coding_rn_rename_sel.txt 2) three_traits_rn_rename.txt Statistical model: y = marker + e Key steps 1. Join the two files by highlight them and then click “AND” Joint button on data Panel. 2. Highlight the joint file and click GLM on Analysis panel. Click OK on the Dada definition dialog window and click RUN button on “Build a Linear Model” dialog window. Results The result is display as “GLM_three_traits_rn_rename + d8coding_rn_rename_sel” on data tree. The result was also saved in the result folder in the tutorial dataset. Case 2: Phenotype + Candidate SNP markers (haploid) + Q Thin case introduce population structure (Q) to reduce false positives due to population stratification. Files used 1) d8coding_rn_rename_sel.txt 2) three_traits_rn_rename.txt 3) popStructure_taxa286_rn_rename.txt. 79 Statistical model: y = marker + Q + e Key steps 1. Join the three files by highlight them and then click “AND” Joint button on data Panel. 2. Highlight the joint file and click GLM on Analysis panel. Change Q1 and Q2 as Covariate and exclude Q3 on the Dada definition dialog window , click OK to go to “Build a Linear Model” dialog window and click RUN button. Results The result is display as “GLM_d8coding_rn_rename_sel + three_traits_rn_rename + popStructure_taxa286_rn_rename” on data tree. Case 3: Phenotype + Candidate SNP markers (haploid) + Q +K Thin case use mixed model approach to incorporate both population structure (Q) and kinship among individuals to reduce false positives due to population stratification and relatedness at individual level. Files used 1) d8coding_rn_rename_sel.txt 2) three_traits_rn_rename.txt 3) popStructure_taxa286_rn_rename.txt. 4) kinship_277taxa_by_Spagedi_rn_sq_rename.txt. Statistical model: y = marker + Q + K + e Key steps 1. Join the top three files by highlight them and then click “AND” Joint button on data Panel. Note: Do not join the kinship file. 2. Highlight the joint file and the kinship file, click MLM on Analysis panel. Change Q1 and Q2 as Covariate and exclude Q3 on the Dada definition dialog window , click OK to go to “Build a Mixed Linear Model” dialog window . Click “” button to add all factors. and click Next button. 3. Modify heritability of dpoll to 0.45, choose the option of “Use the heritability given above” and change analysis method to “EM”. Click Run. Results The result is display as “MLM_Asso_d8coding_rn_rename_sel + three_traits_rn_rename + popStructure_taxa286_rn_rename” on data tree. Case 4: Phenotype + Candidate SSR markers (haploid) This case introduces usage of SSR markers which need to be converted first. Files used 1) haploid_SSR_A 2) diploid_Stru 3) diploid_traits. Statistical model: y = marker + Q + e Key steps 1. Currently the Joint function does not work with directly loaded SSR polymorphism markers such as SSR. They need to be converted first. highlight the SSR data set and click Genotype on data 81 panel. Then choose the “Convert into one gametic alignment. A data called “Haplotype” is added to data tree. 2. Highlight dataset Haplotype, diploid_traits and diploid_Stru , then click “AND” Joint button on data Panel. 3. Highlight the joint file and click GLM on Analysis panel. Change PC1, PC2 and PC2 as Covariate on the Dada definition dialog window , click OK to go to “Build a Linear Model” dialog window and click RUN button. Results The result is display as “GLM_Haplotype + diploid_traits + diploid_Stru” on data tree. Case 5: Phenotype + Candidate SNP markers (diploid) Multiple ploid genetic markers have to be converted to genotype indicated by single character, which can be performed by the function of Genotype in data panel . Files used 1) diploid_SNP 2) diploid_Stru 3) diploid_traits. Statistical model: y = marker + Q + e Key steps 1. Highlight the diploid SNP marker data set and click Genotype on data panel. Then choose the option “ Create alignment based on genotypic status (eg. A:aAa)”. A data called “ GenoStates ” is added to data tree. 2. Highlight dataset GenoStates, diploid_traits and diploid_Stru , then click “AND” Joint button on data Panel. 3. Highlight the joint file and click GLM on Analysis panel. Change PC1, PC2 and PC2 as Covariate on the Dada definition dialog window, click OK to go to “ Build a Linear Model ” dialog window and click RUN button. Results The result is display as “ GLM_diploid_traits + diploid_Stru + GenoStates ” on data tree. Part 3 : Genetic linkage map construction Case Study Key steps: 1 prepare data N1231.txt;2photo 1231.out;3 cent kos;4 s all;5 group;6 s {2 3 4 5 … };7 s 2 4 5; 8 try ; 9map
http://www.comsol.com/support/knowledgebase/838/ http://www.comsol.com/community/forums/general/thread/3182/ Solution Number: 838 Title: Can COMSOL import topological data, meshes and images? Platform: All Platforms Applies to: All Products Versions: 4.2a, 4.3, 4.3a Created: April 1, 2002 Last Modified: January 9, 2013 Categories: Mesh , Import , Geometry , General Keywords: Problem Description Can COMSOL Multiphysics import meshes, topological data, and images? SolutionImporting Meshes Simpleware and Materialise can export volumetric meshes created from 3D scans, that can be directly imported into COMSOL. ( Information about COMSOL's partners. ) More on the COMSOL mesh format can be found in the section The COMSOL File Formats in the COMSOL Multiphysics Reference Guide . Because the images are converted directly into a mesh and not into a geometry object, as in the other methods below, it is advisable to fine-tune the geometry/mesh within partnering software before the import is done to COMSOL. Arbitrary mesh data can be imported to COMSOL, providing the mphtxt mesh format is adhered to. Topological Data, GIS, Digital Elevation Models (DEM) If you have topological information saved in the DEM format, you can bring it into your COMSOL model by selecting Definitions Functions Elevation (DEM) . This gives you a function containing the imported data. To turn this function into an actual geometry, use Geometry More Primitives Parametric Surface . The model StHelens.mph , available for download at the bottom of this article, demonstrates how to fill in the Settings tab of this feature. Note especially that you will often need to increase the number of knots from the default 20 to for example 100 in order to make the COMSOL geometry an accurate copy of the original DEM geometry. The model also shows how to create a solid object bounded by the parametric surface. The Parametric Surface feature can also be used with analytical expressions or interpolation data from a text file. See Case 935 for details on the latter. Importing Images COMSOL supports import of BMP, JPEG, PNG, and GIF images. Definitions Functions Image leads you to the settings needed to convert an image file into a function. As with the DEM import, you can use this function to specify the local z -coordinate of a parametric surface. Another common use of images is to assign material properties based on the color scale. For example, in brains, grey and white matter can have different dielectric properties. Rather than create a complicated geometry of the cross-section of a brain, it can be more convenient to just map these properties from an MRI image. hot_circuit.mph is a toy example showing the principle. This model interpolates the local heat conductivity from a ballpoint drawing of a circuit. Note first the expression for the Color Scaling on the Settings tab of the Image feature, (r+g)/20.8 . The default scaling is (r+g+b)/3 , which results in a number on a linear grayscale from 0 for black to 1 for white. Removing the b means that the white background as well as the gray checkering of the notebook will get a high value and the blue drawing a low value. Finally, as comparisons are interpreted as 1 when true and 0 when false, the scaling expression will evaluate to 1 in the patch and 0 outside of it. This is a useful approach in situations where the colors in your picture represent a discrete set of materials. If you instead want your material parameters to be continuous functions of the color intensity, just skip the comparison. The resulting image function, im1(x,y) , is used in defining the thermal conductivity of the user-generated Material 1 . The value of 5+395 im1(x,y) renders 400 W/(m K) in the patch and 5 W/(m*K) in the surrounding circuit board material. Here the remaining parameters are assumed to be identical in both materials, but you could enter their values too as similar function-dependent expressions. Related Files hot_circuit.mph 327 KB my_circuit.jpg 45 KB StHelens.mph 3.2 MB sthelens.dem 8.5 MB
Chairman’s statement London’s transformation into the Host City of the 2012 Olympic and Paralympic Games continues to gather pace. We are working to deliver an ambitious vision of magical Games that will reinforce the role of sport in modern society, and re-establish the importance of sport in communities and in the lives of young people. We know that hopes, expectations and support for the Games are high. Like most Olympic and Paralympic athletes, this is our once-in-a-lifetime opportunity. We only have one chance to deliver an event that will have a profound and positive impact on millions of people throughout the UK and around the world. Despite very challenging economic conditions, the London Organising Committee of the Olympic Games and Paralympic Games Limited (‘the Company’, ‘LOCOG’) has completed another year of impressive achievement. Our vision is to use the power of the Games to inspire lasting change, and we are fulfilling our commitment to create sports facilities, open spaces, homes, jobs and opportunities for this generation and the next. The scene is setA powerful example of progress across the London 2012 project was the completion in December of the Lee Valley White Water Centre, the first brand new venue to be finished. It opened to the public more than a year before theGames, providing early benefits to the local and sporting communities, and giving an early indication of the great sporting legacy that the Games will leave the UK. In fact, the Olympic Delivery Authority(ODA) completed construction of all the main sporting venues and infrastructure with one year to go to the Games – with the venues ready to be transferred to LOCOG for the installation of Games-time facilities. The first venue in the Olympic Park to be transferred to LOCOG was the Velodrome, in February 2011. The completion of its construction was marked with an event at which Sir Chris Hoy, Victoria Pendleton and other members of Team GB were the first cyclists to ride on the track. This was a special moment in a spectacular venue where we hope to see many British medals won next summer. In addition to the superb work carried out on the Olympic Park by our colleagues at the ODA, the unveiling of the London 2012 countdown clock in Trafalgar Square and the installation of the first set of giant Olympic Rings at St Pancras International station serve to remind residents and visitors alike that the countdown to the start of London 2012 has well and truly begun and that the greatest show on earth is coming soon to our country. Athletes at the heart of our GamesEver since London won the right to host the Games back in 2005, our focus has been on the athletes. We are committed to providing the best possible venues, fields of play, food, accommodation and transport to enable the sportsmen and women of the world to perform at their best. We are also progressing our plans for high-impact sport presentationformats, and for ticketing arrangements that will fill our venues with passionate fans. By doing this we will create an exciting spectator, viewer and broadcaster experience, and showcase the power of sport to inspire greater participation, especially among young people. We are also working with London 2012 partners, sponsors, Government departments, sporting bodies and community groups on activation programmes to enable more sports participation opportunities. For example, as part of London 2012’s Get Set education programme, 14,000 schools and more than five million young people across the UK participated in the 2010 National School Sport Week, organised in July by Lloyds TSB, a LOCOG Tier One partner. Seb Coe, Chair,London Organising Committee of the Olympic Games and Paralympic Games 原文见 http://www.london2012.com/documents/locog-publications/locog-annual-report-2010-11.pdf